Commit 99dc9590 authored by Imran Hussain's avatar Imran Hussain
Browse files

Renewal sender func does some logging and tells people its been run

parent 10248174
{$adminname} has sent out renewal emails to:
{$peoples}
--
The SUCS Account Manager
https://projects.sucs.org/sucs/accountmanager
\ No newline at end of file
......@@ -91,13 +91,31 @@ def sendReminderEmail(listofpeeps):
smtpConn.sendmail(sender, receiver, message.as_string())
smtpConn.quit()
print("Sent reminder email to " + username + " on" + str(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")))
print("Sent reminder email to " + username + " on " + str(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")))
if debugmode > 0: # only send out one email instead of 85464684164864165
sys.exit(0)
else:
print("Renewal email template not found!")
sys.exit(4)
if debugmode == 0:
file = codecs.open("renewal-notify-email", encoding='utf-8')
data = file.read()
file.close()
data = data.replace("{$adminname}",adminname)
data = data.replace("{$peoples}",str(listofpeeps))
sender = "staff@sucs.org"
receiver = ["exec@sucs.org","logs@sucs.org"]
message = MIMEMultipart()
message['From'] = sender
message['To'] = receiver
message['Subject'] = 'Renewal Reminder Sent Out'
messageBody = MIMEText(data, 'plain', "UTF-8")
message.attach(messageBody)
smtpConn = smtplib.SMTP('localhost')
smtpConn.sendmail(sender, receiver, message.as_string())
smtpConn.quit()
def mainMenu():
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment