def send_email( app, to, subject, template ):
msg = Message( subject,
recipients=[to],
html=template,
sender=app.config['MAIL_DEFAULT_SENDER'])
# with app.app_context():
# mail.send(msg)
thr = Thread( target = send_async_email, args = [app, msg])
thr.start()