Skip to content

Commit 02ceaee

Browse files
committed
updated to send emails using only bash
1 parent 247aa28 commit 02ceaee

File tree

4 files changed

+13
-35
lines changed

4 files changed

+13
-35
lines changed

automate/sendemail.py

Lines changed: 0 additions & 29 deletions
This file was deleted.

cronscripts/server-side/monthlyReminder.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,22 @@
33
# This script is for sending the mailing list the meeting reminders every second
44
# Saturday and the Thursday before the next meeting (third Satureday of the month)
55
# Add to crontab like so: 0 0 8-14 * * [`date +"%a"`==Sun]&&/path/to/monthlyReminder.sh
6-
# Add to crontab like so: 0 0 * * * [`date +"%a"`==Thu]&&/path/to/monthlyReminder.sh
6+
# Add to crontab like so: 0 0 * * Thu /path/to/monthlyReminder.sh
77

8+
thelist=""
89
# if Sun then run the python script, else check if the date is new date -3 days
910
if [[ `date +"%a"` == "Sun" ]]; then
10-
python /path/to/automate/sendemail.py
11+
while read -r line || [[ -n "$line" ]]; do
12+
thelist+=$line","
13+
done < /path/to/email-addresses.txt
14+
sendmail $thelist < /path/to/monthly-meeting.txt
1115
else
1216
source path/to/newDate.txt
13-
nextSat=$(date -d "+3 days" +"%Y%m%d")
17+
nextSat=$(date -d "+2 days" +"%Y%m%d")
1418
if [[ $nextSat == $saveDate ]]; then
15-
python /path/to/automate/sendemail.py
19+
while read -r line || [[ -n "$line" ]]; do
20+
thelist+=$line","
21+
done < /path/to/email-addresses.txt
22+
/path/to/sendmail $thelist < /path/to/monthly-meeting.txt
1623
fi
1724
fi

cronscripts/updateDate.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ else
164164
# write new date to file
165165
rm -f $PWD/nextDate.txt
166166
touch $PWD/nextDate.txt
167-
echo "saveDate="\"${saveDate}\""" > $PWD/nextDate.txt
167+
echo $saveDate > $PWD/nextDate.txt
168168

169169

170170
echo "New Date: $newDate Old Date: $oldDate"

nextDate.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
saveDate="YYYYMMDD"
1+
YYYYMMDD

0 commit comments

Comments
 (0)