From 0b16990d169718d2aab6139c36655e042fb0f234 Mon Sep 17 00:00:00 2001 From: zsloan Date: Thu, 27 Aug 2020 15:13:14 -0500 Subject: Added function for sending an invitation e-mail * wqflask/wqflask/user_login.py - Added send_invitation_email function, which does what it says --- wqflask/wqflask/user_login.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'wqflask') diff --git a/wqflask/wqflask/user_login.py b/wqflask/wqflask/user_login.py index cfee0079..9331f369 100644 --- a/wqflask/wqflask/user_login.py +++ b/wqflask/wqflask/user_login.py @@ -139,6 +139,12 @@ def send_verification_email(user_details, template_name = "email/user_verificati send_email(recipient, subject, body) return {"recipient": recipient, "subject": subject, "body": body} +def send_invitation_email(user_email, temp_password, template_name = "email/user_invitation.txt", subject = "You've been added to a GeneNetwork user group"): + recipient = user_email + body = render_template(template_name, temp_password) + send_email(recipient, subject, body) + return {"recipient": recipient, "subject": subject, "body": body} + @app.route("/manage/verify_email") def verify_email(): if 'code' in request.args: -- cgit v1.2.3