2023-08-05 21:25:18 +12:00
|
|
|
from flask import render_template, current_app
|
|
|
|
from flask_babel import _
|
|
|
|
from app.email import send_email
|
|
|
|
|
|
|
|
|
|
|
|
def send_password_reset_email(user):
|
|
|
|
token = user.get_reset_password_token()
|
2023-12-03 22:41:15 +13:00
|
|
|
send_email(_('[PieFed] Reset Your Password'),
|
|
|
|
sender='PieFed <rimu@chorebuster.net>',
|
2023-08-05 21:25:18 +12:00
|
|
|
recipients=[user.email],
|
|
|
|
text_body=render_template('email/reset_password.txt',
|
|
|
|
user=user, token=token),
|
|
|
|
html_body=render_template('email/reset_password.html',
|
|
|
|
user=user, token=token))
|
|
|
|
|
|
|
|
|
|
|
|
def send_welcome_email(user):
|
2023-12-03 22:41:15 +13:00
|
|
|
send_email(_('Welcome to PieFed'),
|
|
|
|
sender='PieFed <rimu@chorebuster.net>',
|
2023-08-05 21:25:18 +12:00
|
|
|
recipients=[user.email],
|
|
|
|
text_body=render_template('email/welcome.txt', user=user),
|
|
|
|
html_body=render_template('email/welcome.html', user=user))
|
2023-08-26 15:41:11 +12:00
|
|
|
|
|
|
|
|
|
|
|
def send_verification_email(user):
|
|
|
|
send_email(_('Please verify your email address'),
|
2023-12-03 22:41:15 +13:00
|
|
|
sender='PieFed <rimu@chorebuster.net>',
|
2023-08-26 15:41:11 +12:00
|
|
|
recipients=[user.email],
|
|
|
|
text_body=render_template('email/verification.txt', user=user),
|
|
|
|
html_body=render_template('email/verification.html', user=user))
|