email box empty styling
This commit is contained in:
parent
1ee8a58117
commit
5cb49f4cb1
19 changed files with 547 additions and 67 deletions
|
|
@ -159,3 +159,72 @@ def build_employee_invitation_email(
|
|||
</html>"""
|
||||
|
||||
return subject, body_text, body_html
|
||||
|
||||
|
||||
def build_welcome_email(
|
||||
*,
|
||||
first_name: str,
|
||||
work_email: str,
|
||||
organization: str | None,
|
||||
login_url: str,
|
||||
is_company_account: bool,
|
||||
) -> tuple[str, str, str]:
|
||||
name = first_name.strip() or "there"
|
||||
subject = "Welcome to AGMail"
|
||||
org_line = (
|
||||
f"Your {work_email} mailbox is ready."
|
||||
if is_company_account
|
||||
else f"Your {work_email} address is active."
|
||||
)
|
||||
admin_note = (
|
||||
"Your organization administrator manages this account."
|
||||
if is_company_account and organization
|
||||
else ""
|
||||
)
|
||||
|
||||
body_text = (
|
||||
f"Hello {name},\n\n"
|
||||
f"Welcome to {BRAND_NAME}. {org_line}\n\n"
|
||||
f"What you can do now:\n"
|
||||
f"- Compose your first email from the inbox\n"
|
||||
f"- Ask AG Agent to summarize threads and surface action items\n"
|
||||
f"- Review account and security settings\n\n"
|
||||
f"Sign in: {login_url}\n\n"
|
||||
f"{admin_note}\n\n"
|
||||
f"—\n"
|
||||
f"AGMail Team\n"
|
||||
f"{BRAND_NAME}"
|
||||
).strip()
|
||||
|
||||
safe_name = _escape(name)
|
||||
safe_email = _escape(work_email)
|
||||
safe_login = _escape(login_url)
|
||||
safe_org = _escape(organization or "")
|
||||
safe_admin = _escape(admin_note)
|
||||
|
||||
body_html = f"""<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8" /><title>{_escape(subject)}</title></head>
|
||||
<body style="margin:0;padding:32px 16px;background:#fffdfb;color:#080821;font-family:'DM Sans',sans-serif;">
|
||||
<table role="presentation" width="100%" cellspacing="0" cellpadding="0">
|
||||
<tr><td align="center">
|
||||
<table role="presentation" width="100%" style="max-width:600px;background:#fff;border:1px solid #eee9e5;border-radius:20px;">
|
||||
<tr><td style="padding:28px 32px;">
|
||||
<p style="margin:0 0 12px;font-size:12px;font-weight:700;letter-spacing:1px;text-transform:uppercase;color:#ff6a52;">Welcome</p>
|
||||
<h1 style="margin:0 0 16px;font-size:24px;">Welcome to AGMail</h1>
|
||||
<p style="margin:0 0 16px;font-size:15px;line-height:1.7;color:#67677a;">Hello {safe_name}, your mailbox <strong>{safe_email}</strong> is ready.</p>
|
||||
{"<p style='margin:0 0 16px;font-size:14px;color:#67677a;'>Organization: <strong>" + safe_org + "</strong></p>" if organization else ""}
|
||||
<ul style="margin:0 0 20px;padding-left:20px;color:#67677a;font-size:14px;line-height:1.7;">
|
||||
<li>Compose email from your inbox</li>
|
||||
<li>Use AG Agent for summaries and action items</li>
|
||||
<li>Review security settings after sign-in</li>
|
||||
</ul>
|
||||
<a href="{safe_login}" style="display:inline-block;padding:12px 18px;border-radius:10px;background:#080821;color:#fff;text-decoration:none;font-weight:700;">Open AGMail</a>
|
||||
{"<p style='margin:18px 0 0;font-size:12px;color:#8d8792;'>" + safe_admin + "</p>" if admin_note else ""}
|
||||
</td></tr>
|
||||
</table>
|
||||
</td></tr>
|
||||
</table>
|
||||
</body></html>"""
|
||||
|
||||
return subject, body_text, body_html
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue