mgt c10 checkpoint with debug

This commit is contained in:
2024-08-05 00:59:01 -07:00
parent ed9df4db6f
commit 3d1f21ffcb
9 changed files with 133 additions and 25 deletions

View File

@@ -1,5 +1,6 @@
from flask import render_template
from flask_mail import Message
from app import mail
from app import mail, app
def send_email(subject, sender, recipients, text_body, html_body):
msg = Message(subject, sender=sender, recipients=recipients)
@@ -7,3 +8,15 @@ def send_email(subject, sender, recipients, text_body, html_body):
msg.html = html_body
mail.send(msg)
def send_password_reset_email(user):
token = user.get_reset_password_token()
hostname = app.config['REAL_HOSTNAME']
send_email('[Blog] Reset Password',
sender=app.config['ADMINS'][0],
recipients=[user.email],
text_body=render_template('email/reset_password.txt', hostname=hostname, user=user, token=token),
html_body=render_template('email/reset_password.html', hostname=hostname, user=user, token=token))