aboutsummaryrefslogtreecommitdiff
path: root/app/tasks/emails.py
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2018-05-14 00:40:34 +0100
committerrubenwardy <rw@rubenwardy.com>2018-05-14 00:40:34 +0100
commit73fa5d11866e1ab36463c3a773b8ca0d3671a709 (patch)
treee1e21333d32746d1a3c02d81033f7561779672b0 /app/tasks/emails.py
parentacc48c72620fe9bfdf3c72666d57af7e3c9306d0 (diff)
downloadcheatdb-73fa5d11866e1ab36463c3a773b8ca0d3671a709.tar.xz
Add email support
Diffstat (limited to 'app/tasks/emails.py')
-rw-r--r--app/tasks/emails.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/tasks/emails.py b/app/tasks/emails.py
new file mode 100644
index 0000000..7040d38
--- /dev/null
+++ b/app/tasks/emails.py
@@ -0,0 +1,11 @@
+from flask import *
+from flask_mail import Message
+from app import mail
+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)