diff options
| author | rubenwardy <rw@rubenwardy.com> | 2018-05-14 00:40:34 +0100 |
|---|---|---|
| committer | rubenwardy <rw@rubenwardy.com> | 2018-05-14 00:40:34 +0100 |
| commit | 73fa5d11866e1ab36463c3a773b8ca0d3671a709 (patch) | |
| tree | e1e21333d32746d1a3c02d81033f7561779672b0 /app/tasks | |
| parent | acc48c72620fe9bfdf3c72666d57af7e3c9306d0 (diff) | |
| download | cheatdb-73fa5d11866e1ab36463c3a773b8ca0d3671a709.tar.xz | |
Add email support
Diffstat (limited to 'app/tasks')
| -rw-r--r-- | app/tasks/__init__.py | 2 | ||||
| -rw-r--r-- | app/tasks/emails.py | 11 |
2 files changed, 12 insertions, 1 deletions
diff --git a/app/tasks/__init__.py b/app/tasks/__init__.py index 9ee293e..40a824c 100644 --- a/app/tasks/__init__.py +++ b/app/tasks/__init__.py @@ -41,4 +41,4 @@ def make_celery(app): celery = make_celery(app) -from . import importtasks, forumtasks +from . import importtasks, forumtasks, emails 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) |
