summaryrefslogtreecommitdiff
path: root/remind.php
blob: 635c2c74f16fcd7f8f7f9fac9ea0c7c199386f98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/php
<?
require_once("database.php");
$db = new DB();

$db->closeVotes();

$id = 0;
$page = 1;

$voters = $db->getStatement('get reminder voters');
$voters->execute();

$outstanding = $db->getStatement('list my unvoted decisions');
$outstanding->bindParam(':id',$id);
$outstanding->bindParam(':page',$page);

while ($v = $voters->fetch()) {
	$id = $v['id'];
	$outstanding->execute();
	$msg ='';
	while ($row=$outstanding->fetch()) {
		$msg .= ($row['votetype'] ? 'vote ' : 'motion ') . $row['tag'] . ' ' . $row['title'] . "\nDue: " . $row['due'] . "\nhttps://community.cacert.org/board/motions.php?motion=" . $row['tag'] . "\n\n";
	}
	if ($msg) {
		// form email
		$name = $v['name'];
		$body = <<<BODY
Dear $name,

You have not voted in the following CAcert Board vote(s)/motion(s):

$msg


To view all your outstanding motions: https://community.cacert.org/board/motions.php?unvoted=1

Kind regards,
the vote system

BODY;
		$db->remind_notify($v['email'],"Outstanding CAcert board votes",$body); 
	}
}
?>