#!/bin/sh

############################################################################
#
# This script emails a message to the specified users with an updated 
# electoral vote estimate. The email itself is one of several texts
# generated by the Python script current_ev.py. This script is triggered by
# the Unix cron daemon.
#
# Author: Andrew Ferguson <adferguson@alumni.princeton.edu>
#
# Script written for election.princeton.edu run by Samuel S.-H. Wang under
# noncommercial-use-only license:
# You may use or modify this software, but only for noncommericial purposes.
# To seek a commercial-use license, contact sswang@princeton.edu
#
############################################################################

EMAIL_FILE=/home/election/autotext/email_update.txt
EMAIL_LIST=/home/election/private/email_list.txt
SUBJECT="Update from Princeton Election Consortium"

cat $EMAIL_LIST | while read i; do
	cat $EMAIL_FILE | mail -s "$SUBJECT" $i
done

