]>
git.datanom.net - flask-test.git/blob - app/emails.py
1 from flask_mail
import Message
4 from flask
import render_template
5 from config
import ADMINS
6 from .decorators
import async
9 def send_async_email(app
, msg
):
10 with app
.app_context():
13 def send_email(subject
, sender
, recipients
, text_body
, html_body
):
14 msg
= Message(subject
, sender
=sender
, recipients
=recipients
)
17 send_async_email(app
, msg
)
19 def follower_notification(followed
, follower
):
20 send_email("[WPP] %s is now following you!" % follower
.nickname
,
23 render_template("follower_email.txt",
24 user
=followed
, follower
=follower
),
25 render_template("follower_email.html",
26 user
=followed
, follower
=follower
))
This page took 0.057901 seconds and 6 git commands to generate.