aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto@gentoo.org>2017-08-27 16:34:34 +0000
committerJorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto@gentoo.org>2017-08-27 16:35:08 +0000
commitc3e62801d978b906e1879ebcb9e43d99c00c77e6 (patch)
tree0f9329b7286d43ad80edd0fe544a96e15bfb66ab /mail-scripts
parentLast missing master ballot & casting history for trustees2005/2006. (diff)
downloadelections-c3e62801d978b906e1879ebcb9e43d99c00c77e6.tar.gz
elections-c3e62801d978b906e1879ebcb9e43d99c00c77e6.tar.bz2
elections-c3e62801d978b906e1879ebcb9e43d99c00c77e6.zip
Add scripts for sending the confirmation emails for elections.
Signed-off-by: Jorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto@gentoo.org>
Diffstat (limited to 'mail-scripts')
-rw-r--r--mail-scripts/email6
-rw-r--r--mail-scripts/mail-table1
-rw-r--r--mail-scripts/mail-voters17
3 files changed, 24 insertions, 0 deletions
diff --git a/mail-scripts/email b/mail-scripts/email
new file mode 100644
index 0000000..df5701f
--- /dev/null
+++ b/mail-scripts/email
@@ -0,0 +1,6 @@
+Hello.
+
+INSERT
+For the election officials for the <election-name> election,
+
+<signature>
diff --git a/mail-scripts/mail-table b/mail-scripts/mail-table
new file mode 100644
index 0000000..24d72bf
--- /dev/null
+++ b/mail-scripts/mail-table
@@ -0,0 +1 @@
+<nick> <email>
diff --git a/mail-scripts/mail-voters b/mail-scripts/mail-voters
new file mode 100644
index 0000000..c38f895
--- /dev/null
+++ b/mail-scripts/mail-voters
@@ -0,0 +1,17 @@
+election=<election-name>
+while read num user;
+do grep -q "confirmation $num" master-${election} || continue;
+ email=$(grep "$user" mail-table);
+ if [[ ! -z $email ]]; then
+ to="${email#$user }"
+ else
+ to="$user@gentoo.org"
+ fi
+ ( echo "To: $to";
+ echo "From: elections@gentoo.org"
+ echo "Date: $(date -R)";
+ echo "Subject: Your ${election} confirmation id";
+ echo "";
+ sed -e "s/^INSERT.*/Your confirmation number is $num./" email -e "s/ELECTION/$election/"; ) \
+ | /usr/lib/sendmail -oi $to;
+done < confs-${election}