summaryrefslogtreecommitdiff
path: root/remind.php
diff options
context:
space:
mode:
authorcommunity.cacert.org <community.cacert.org@d4452222-2f33-11de-9270-010000000000>2009-06-12 05:01:29 +0000
committercommunity.cacert.org <community.cacert.org@d4452222-2f33-11de-9270-010000000000>2009-06-12 05:01:29 +0000
commita159b44435bff6efc2ad25c232d163d48eae1044 (patch)
tree8bddfbc38ad6113878f17a27e391f890b2d8a0dd /remind.php
parenta66ba7060a9e2ea9261dfe6f862110fe27ea26ec (diff)
downloadcacert-boardvoting-a159b44435bff6efc2ad25c232d163d48eae1044.tar.gz
cacert-boardvoting-a159b44435bff6efc2ad25c232d163d48eae1044.tar.xz
cacert-boardvoting-a159b44435bff6efc2ad25c232d163d48eae1044.zip
add reminder functionality
git-svn-id: http://svn.cacert.cl/Software/Voting/vote@58 d4452222-2f33-11de-9270-010000000000
Diffstat (limited to 'remind.php')
-rwxr-xr-xremind.php45
1 files changed, 45 insertions, 0 deletions
diff --git a/remind.php b/remind.php
new file mode 100755
index 0000000..635c2c7
--- /dev/null
+++ b/remind.php
@@ -0,0 +1,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);
+ }
+}
+?>