aboutsummaryrefslogtreecommitdiff
path: root/app/tasks
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2018-07-06 22:52:19 +0100
committerrubenwardy <rw@rubenwardy.com>2018-07-06 22:55:55 +0100
commit9dd3570a52027ecb8e84dacb87d66fc511812c3c (patch)
tree592de230866ec516d44de1131f3b64b4a549bfb2 /app/tasks
parenta6c8b12cdd55906e03d79c4c776914cd43567055 (diff)
downloadcheatdb-9dd3570a52027ecb8e84dacb87d66fc511812c3c.tar.xz
Add email on Flask error
Diffstat (limited to 'app/tasks')
-rw-r--r--app/tasks/emails.py18
1 files changed, 14 insertions, 4 deletions
diff --git a/app/tasks/emails.py b/app/tasks/emails.py
index fbefbc7..5af5769 100644
--- a/app/tasks/emails.py
+++ b/app/tasks/emails.py
@@ -22,7 +22,17 @@ from app.tasks import celery
@celery.task()
def sendVerifyEmail(newEmail, token):
- msg = Message("Verify email address", recipients=[newEmail])
- msg.body = "This is a verification email!"
- msg.html = render_template("emails/verify.html", token=token)
- mail.send(msg)
+ msg = Message("Verify email address", recipients=[newEmail])
+ msg.body = "This is a verification email!"
+ msg.html = render_template("emails/verify.html", token=token)
+ mail.send(msg)
+
+@celery.task()
+def sendEmailRaw(to, subject, text, html):
+ from flask_mail import Message
+ msg = Message(subject, recipients=to)
+ if text:
+ msg.body = text
+ if html:
+ msg.html = html
+ mail.send(msg)