diff --git a/app/email.py b/app/email.py index e7b0552..9503b73 100644 --- a/app/email.py +++ b/app/email.py @@ -1,11 +1,9 @@ import logging -import yaml import json import os import aiosmtplib from urllib.parse import quote from email.message import EmailMessage -from app.constants import user_directory logger = logging.getLogger('app-logger') @@ -21,8 +19,28 @@ def generate_edit_link(user_config: dict) -> str: return edit_link -def generate_email_content(edit_link: str): - return f"Sent via aiosmtplib! Here's your edit link: {edit_link}" +def generate_email_content(edit_link: str, user_config: dict): + name: str = user_config.get("general", {}).get("name") + if name is None: + name = "WATcloud user" + first_name:str = name.split(" ")[0] + + email_body = ( + f"" + f"
" + f""
+ f"Hello {first_name},
"
+ f"Greetings from WATcloud! Your WATcloud user config edit link is ready for you:
"
+ f"Edit Link
"
+ f"If you have any questions or need assistance, don't hesitate to reach out"
+ f" to your WATcloud contact or the WATcloud team at"
+ f" infra-outreach@watonomous.ca.
"
+ f"Vroom vroom,
"
+ f"WATcloud Team.
"
+ f"