[SUCS Devel] [Git][sucs/accountmanager][master] 3 commits: Add email templates for societies and associates
Alexander Moras
vectre at sucs.org
Wed Mar 13 14:31:24 GMT 2019
Alexander Moras pushed to branch master at sucs / accountmanager
Commits:
134ac336 by Alexander Moras at 2019-03-13T14:25:03Z
Add email templates for societies and associates
- - - - -
0e2557ce by Alexander Moras at 2019-03-13T14:26:12Z
Add renewal reminder options for societies and associates
- - - - -
16d669c6 by Alexander Moras at 2019-03-13T14:31:11Z
Changed debug so emails get sent to current user
- - - - -
3 changed files:
- + 2-email
- + 5-email
- sucsam.py
Changes:
=====================================
2-email
=====================================
@@ -0,0 +1,15 @@
+Hi {$realname},
+
+Your Swansea University Computer Society account ({$username}) is up for renewal, this costs just £5 for the academic year.
+
+You can renew by simply buying membership at https://sucs.org/join.
+
+Failure to do so will result in your account being deleted.
+
+If you believe you have already paid for this year please let us know ASAP.
+
+--
+Sent by {$adminname}
+Swansea University Computer Society
+https://sucs.org/
+
=====================================
5-email
=====================================
@@ -0,0 +1,15 @@
+Hi {$realname},
+
+Your Swansea University Computer Society account ({$username}) is up for renewal, this costs £20 for the academic year.
+
+You can renew by simply buying associate membership at https://sucs.org/join.
+
+Failure to do so will result in your account being deleted.
+
+If you believe you have already paid for this year please let us know ASAP.
+
+--
+Sent by {$adminname}
+Swansea University Computer Society
+https://sucs.org/
+
=====================================
sucsam.py
=====================================
@@ -83,7 +83,7 @@ def sendReminderEmail(listofpeeps):
data = data.replace("{$adminname}",adminname)
sender = 'staff at sucs.org'
if debugmode > 0:
- receiver = 'imranh at sucs.org'
+ receiver = adminname + '@sucs.org'
else:
receiver = email
message = MIMEMultipart()
@@ -101,8 +101,8 @@ def sendReminderEmail(listofpeeps):
if debugmode > 0: # only send out one email instead of 85464684164864165
sys.exit(0)
- else:
- print("Renewal email template not found!")
+ else:
+ print("Renewal email template not found!")
sys.exit(4)
if debugmode == 0:
file = codecs.open("renewal-notify-email", encoding='utf-8')
@@ -367,22 +367,24 @@ def deleteUser(peopleList):
def reminderMenu():
print("")
- print("Double check https://sucs.org/Admin/SU that everyone that has paid to renew has been marked as renwed. This tool doesn't do that job yet!")
+ print("Double check https://sucs.org/Admin/SU that everyone that has paid to renew has been marked as renewed. This tool doesn't do that job yet!")
print("")
print("1. View a list of accounts that aren't marked as renewed in the DB")
- print("2 Semd email to all reminding them to renew")
- print("2.1 Semd email to all students reminding them to renew")
+ print("2 Send email to ALL reminding them to renew")
+ print("2.1 Send email to all STUDENTS reminding them to renew")
+ print("2.2 Send email to all SOCIETIES reminding them to renew")
+ print("2.3 Send email to all ASSOCIATES reminding them to renew")
print("0. Return to main menu")
option = input("Option: ")
if option == "1":
for student in studentsBad:
- print(str(student[0]) + " because the DB says: " + str(student[1]))
+ print(str(student[0]) + " last paid: " + str(student[1]))
for soc in societiesBad:
- print(str(soc[0]) + " because the DB says: " + str(soc[1]))
+ print(str(soc[0]) + " last paid: " + str(soc[1]))
for ass in associatesBad:
- print(str(ass[0]) + " because the DB says: " + str(ass[1]))
+ print(str(ass[0]) + " last paid: " + str(ass[1]))
reminderMenu()
if option == "2":
if len(studentsBad) > 0:
@@ -394,6 +396,12 @@ def reminderMenu():
if option == "2.1":
if len(studentsBad) > 0:
sendReminderEmail(studentsBad)
+ if option == "2.2":
+ if len(societiesBad) > 0:
+ sendReminderEmail(societiesBad)
+ if option == "2.3":
+ if len(associatesBad) > 0:
+ sendReminderEmail(associatesBad)
if option == "0":
mainMenu()
else:
View it on GitLab: https://projects.sucs.org/sucs/accountmanager/compare/1db8ade78589e23eb833dbfb00f950b50cf71f77...16d669c6f3b60c7ed98505d7ee2229e64ca8dbd4
--
View it on GitLab: https://projects.sucs.org/sucs/accountmanager/compare/1db8ade78589e23eb833dbfb00f950b50cf71f77...16d669c6f3b60c7ed98505d7ee2229e64ca8dbd4
You're receiving this email because of your account on projects.sucs.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sucs.org/pipermail/devel/attachments/20190313/24dd1de9/attachment-0001.html>
More information about the Devel
mailing list