We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent the server from waiting (thus slowing down) while the email delivery (eg. Reset Password request) is being sent.
Old:
from flask_mail import Mail def send_email(subject, sender, recipients, message): msg = Message(subject, sender=sender, recipients=recipients) msg.html = message mail.send() # mail = Mail(app)
New:
def send_email_bg(app, message): with app.app_context(): mail.send(message) def send_email(subject, sender, recipients, message): msg = Message(subject, sender=sender, recipients=recipients) msg.html = message Thread(target=send_email_bg, args=(app, msg)).start()
The text was updated successfully, but these errors were encountered:
asynchronous email #20 & better login page
36243cb
onlyphantom
No branches or pull requests
Prevent the server from waiting (thus slowing down) while the email delivery (eg. Reset Password request) is being sent.
Old:
New:
The text was updated successfully, but these errors were encountered: