feat: changed confirmation email from txt to html

This commit is contained in:
Blake Ridgway 2025-04-05 20:21:29 -05:00
parent 14cac6177f
commit 8e5cce4294

View file

@ -16,15 +16,16 @@ def send_confirmation_email(email):
SMTP_USER = os.getenv('SMTP_USER')
SMTP_PASSWORD = os.getenv('SMTP_PASSWORD')
# Create the message for the
unsubscribe_link = f"{request.url_root}unsubscribe?email={email}"
subject = 'Thanks for subscribing!'
body = ("Thanks for subscribing!\n\n"
"We're excited to share our journey with you.\n\n"
f"If you ever wish to unsubscribe, please click <a href='{unsubscribe_link}'>here</a>."
html_body = render_template(
'confirmation_email.html',
unsubscribe_link=unsubscribe_link
)
msg = MIMEText(body, 'html', 'utf-8')
msg = MIMEText(html_body, 'html', 'utf-8') # Specify HTML
msg['Subject'] = subject
msg['From'] = SMTP_USER
msg['To'] = email