diff --git a/flask_app.py b/flask_app.py index 4935331..16b932b 100644 --- a/flask_app.py +++ b/flask_app.py @@ -479,6 +479,7 @@ def promote_from_waitlist(): msg = 'Dear ' + mlh_info['first_name'] + ',\n\n' msg += 'You are off the waitlist!\n' msg += 'Room has opened up, and you are now welcome to come, we look forward to seeing you!\n' + msg += '**Note** Please see https://hack.wpi.edu and the event Slack for important information regarding the event format in accordance with new COVID safety guidelines\n' msg += 'If you cannot make it, please drop your application at https://hack.wpi.edu/dashboard.\n' send_email(mlh_info['email'], "Hack@WPI - You're off the Waitlist!", msg) @@ -553,20 +554,26 @@ def send_email(to, subject, body): server.starttls() user = api_keys['smtp_email']['user'] sender = api_keys['smtp_email']['sender'] + # Get bcc info if it exists + bcc = None + if ('bcc' in api_keys['smtp_email']): + bcc = api_keys['smtp_email']['bcc'] # Login if we're using server with auth if ('pass' in api_keys['smtp_email']): server.login(user, api_keys['smtp_email']['pass']) - msg = _create_MIMEMultipart(subject, sender, to, body, user) + msg = _create_MIMEMultipart(subject, sender, to, body, user, bcc) server.send_message(msg) print("Sucess! (Email to " + to) -def _create_MIMEMultipart(subject, sender, to, body, user=None): +def _create_MIMEMultipart(subject, sender, to, body, user=None, bcc=None): msg = MIMEMultipart() msg['Subject'] = subject msg['From'] = sender + if (bcc): + msg['Bcc'] = bcc msg.add_header('reply-to', user) if type(to) == list: msg['To'] = ", ".join(to) diff --git a/manage_waitlist.py b/manage_waitlist.py index 26b269c..ba7c9e9 100644 --- a/manage_waitlist.py +++ b/manage_waitlist.py @@ -52,9 +52,9 @@ msg += ' ' + str(errs) + '\n' print(msg) -# requests.post(WEBHOOK_URL, { -# "content": msg -# }) +requests.post(WEBHOOK_URL, { + "content": msg +}) -# send_email('hack@wpi.edu', 'HackWPI - Daily Waitlist Report!', msg) +send_email('hack@wpi.edu', 'HackWPI - Daily Waitlist Report!', msg) send_email('mikel@wpi.edu', 'HackWPI - Daily Waitlist Report!', msg) diff --git a/templates/home b/templates/home index bfb9d77..b2a6029 160000 --- a/templates/home +++ b/templates/home @@ -1 +1 @@ -Subproject commit bfb9d7799fbb8630f4351f043a05aa617964becf +Subproject commit b2a60294b8f9d37d8c486cd817f8260cc860caad