Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
Refresh email template styling (#6524)
Peter Chinmanb1ed511e8a52
diff --git a/Cargo.lock b/Cargo.lockindex 27d5c0c8ac..973ac3aa22 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -15337,6 +15337,7 @@ version = "0.1.0"dependencies = ["anyhow","aws-sdk-sesv2",+ "html-escape","lettre","macro_env_var","mockall",diff --git a/apps/web/public/macro-email-logo.png b/apps/web/public/macro-email-logo.pngnew file mode 100644index 0000000000..8f93513e32Binary files /dev/null and b/apps/web/public/macro-email-logo.png differdiff --git a/crates/email_formatting/README.md b/crates/email_formatting/README.mdnew file mode 100644index 0000000000..22a55b8790--- /dev/null+++ b/crates/email_formatting/README.md@@ -0,0 +1,49 @@+# Transactional email styling++Repository-owned email templates share a light neutral background, white card,+system sans-serif type, and dark buttons. Keep their shell and spacing consistent+across the different template engines; essential styles are inline and layouts+use presentation tables so the emails do not depend on web fonts or modern CSS.++## Templates++- `templates/digest.html`: notification digest (Askama).+- `../invite_email/templates/`: personal, channel, and team invitations (Askama).+- `../ses_client/templates/invite_user.html`: organization invitation (Rust replacements).+- `../../services/authentication_service/src/api/email/_verify_email_template.html`:+ email verification (Rust replacements).+- `../../services/authentication_service/src/api/merge/_merge_request_template.html`:+ account merge code (Rust replacements).+- `../../infra/stacks/fusionauth-instance/templates/`: login code and email+ verification (FusionAuth FreeMarker, with the auth service URL supplied by Pulumi).++Mobile welcome/nurture emails are owned by Loops and are not defined here.++## Logo and rollout++Digest and invitation templates use the anonymously readable orange Macro PNG at+`https://static-file-service.macro.com/file/b911aba9-94a6-435c-aa16-8404739f13b0`.++Authentication templates use `https://macro.com/app/macro-email-logo.png`, served from+`apps/web/public/macro-email-logo.png`. This 192 × 192 PNG is an export of the+current `apps/web/src/components/icon/macro-logo.svg` with fill `#222222` on white.+The opaque background keeps the mark legible when an email client changes colors.+Use the existing SVG as the source when regenerating the raster asset.++Deploy the web asset before rolling out the authentication or FusionAuth templates.+Verify that the public URL returns the PNG; an HTML fallback response is not enough.+FusionAuth template changes require deploying the `fusionauth-instance` stack.++## Preview++With Jinja2 installed, run `python3 crates/email_formatting/preview_digest.py`+from the repository root to preview a digest using sample notifications and the+public logo (requires network access). This+convenience preview translates Askama expressions to Jinja2; Rust compilation+and package tests remain the check for production template compatibility.++## Styling reference++Login code and notification digest, rendered with sample data:++diff --git a/crates/email_formatting/preview_digest.py b/crates/email_formatting/preview_digest.pyindex 58f6d0be00..8cf40bdef9 100644--- a/crates/email_formatting/preview_digest.py+++ b/crates/email_formatting/preview_digest.py@@ -75,6 +75,8 @@ def askama_to_jinja2(src: str) -> str:src,)+ src = src.replace("unsubscribe_url.as_ref()", "unsubscribe_url")+# Askama uses `!expr` for logical negation; Jinja2 uses `not expr`# Only touch it inside block tags ({% … %})def replace_bang(m: re.Match) -> str:@@ -94,11 +96,15 @@ def main() -> None:raw = TEMPLATE_PATH.read_text(encoding="utf-8")converted = askama_to_jinja2(raw)- env = Environment(autoescape=False)+ env = Environment(autoescape=True)tmpl = env.from_string(converted)- html = tmpl.render(notifs=DUMMY_NOTIFS)-+ html = tmpl.render(+ notifs=DUMMY_NOTIFS,+ total_count=len(DUMMY_NOTIFS),+ num_truncated=0,+ unsubscribe_url="https://example.com/unsubscribe",+ )# Write to a temp file that persists until the script exitswith tempfile.NamedTemporaryFile(mode="w",diff --git a/crates/email_formatting/previews/transactional-emails.png b/crates/email_formatting/previews/transactional-emails.pngnew file mode 100644index 0000000000..0adda5bb09Binary files /dev/null and b/crates/email_formatting/previews/transactional-emails.png differdiff --git a/crates/email_formatting/templates/digest.html b/crates/email_formatting/templates/digest.htmlindex 834afa1c58..ac015ec908 100644--- a/crates/email_formatting/templates/digest.html+++ b/crates/email_formatting/templates/digest.html@@ -1,270 +1,264 @@<!doctype html>-<html- xmlns:o="urn:schemas-microsoft-com:office:office"- xmlns:v="urn:schemas-microsoft-com:vml"- xmlns="http://www.w3.org/1999/xhtml"->+<html lang="en" xmlns:o="urn:schemas-microsoft-com:office:office"><head>- <title>Macro Notification Digest</title>- <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />- <meta content="width=device-width, initial-scale=1" name="viewport" />+ <meta charset="utf-8" />+ <meta name="viewport" content="width=device-width, initial-scale=1" />+ <meta name="x-apple-disable-message-reformatting" />+ <meta+ name="format-detection"+ content="telephone=no, date=no, address=no, email=no"+ />+ <meta name="color-scheme" content="light" />+ <meta name="supported-color-schemes" content="light" />+ <title>Your Macro updates</title><!--[if mso]>- <noscript>- <xml>- <o:OfficeDocumentSettings>- <o:PixelsPerInch>96</o:PixelsPerInch>- <o:AllowPNG />- </o:OfficeDocumentSettings>- </xml>- </noscript>+ <noscript+ ><xml+ ><o:OfficeDocumentSettings+ ><o:PixelsPerInch>96</o:PixelsPerInch+ ><o:AllowPNG /></o:OfficeDocumentSettings></xml+ ></noscript><![endif]-->-- <link rel="preconnect" href="https://fonts.googleapis.com">- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>- <link href="https://fonts.googleapis.com/css2?family=Inter:opsz,[email protected],400..500&display=swap" rel="stylesheet">-+ <style>+ @media screen and (max-width: 600px) {+ .email-page {+ padding: 24px 12px !important;+ }+ .email-content {+ padding: 28px 24px !important;+ }+ .email-heading {+ font-size: 26px !important;+ line-height: 34px !important;+ }+ }+ </style></head><bodystyle="+ margin: 0;+ padding: 0;+ width: 100%;+ background-color: #f5f5f4;-webkit-text-size-adjust: 100%;-ms-text-size-adjust: 100%;- word-spacing: normal;- padding: 0;- margin: 0;">- <div style="padding: 60px 20px; width: 100%">- <div- style="- font-family: "Inter", sans-serif;- background-color: #fcfcfc;- border: 1px solid #e0e0e0;- box-sizing: border-box;- border-radius: 4px;- max-width: 570px;- overflow: hidden;- font-size: 15px;- margin: 0 auto;- width: 100%;- "- >- <div- style="- background-color: #f5f5f5;- color: #090909;- box-sizing: border-box;- line-height: 60px;- font-size: 18px;- /* 26px left so the logo's center (26 + 15) matches the notif- bullets' center (20 + 17 + 4 = 41px) */- padding: 0 20px 0 26px;- height: 60px;- width: 100%;- font-family: "Inter", sans-serif;- "- >- <img- src="https://macro.com/app/macro-logo-orange.png"- width="30"- height="20"- alt=""- style="- vertical-align: middle;- margin-right: 10px;- border: 0;- "- />You have {{ total_count }} new {% if total_count == 1 %}notification{%- else %}notifications{% endif %}- </div>- <hr- style="- border-top: 1px dashed #e0e0e0;- border-bottom: none;- border-right: none;- border-left: none;- margin: 0;- "- />- <div style="padding: 0 20px 20px 20px; box-sizing: border-box">- {% for notif in notifs %}- <a- style="- text-decoration: none;- padding: 10px 17px;- display: block;- color: #090909;- "- href="https://macro.com"- target="_blank"- >- <table- style="border: none; width: 100%; margin-bottom: 4px"- cellpadding="0"- cellspacing="0"- >- <tbody>- <tr>- <td- style="- vertical-align: middle;- width: 12px;- padding-right: 10px;- "- >- <div- style="- background-color: #ff8f0088;- border: 1px solid #ff8f00;- box-sizing: border-box;- border-radius: 100%;- height: 8px;- width: 8px;- "- ></div>- </td>- <td- style="- vertical-align: middle;- color: #636363;- font-size: 16px;- word-wrap: break-word;- overflow-wrap: break-word;- word-break: break-word;- "- >- {{ notif.title }}- </td>- <td- style="- vertical-align: middle;- text-align: right;- color: #636363;- font-size: 12px;- white-space: nowrap;- padding-left: 10px;- "- >- {{ notif.created_at.format("%Y-%m-%d") }}- </td>- </tr>- </tbody>- </table>- <table- style="border: none; width: 100%; table-layout: fixed"- cellpadding="0"- cellspacing="0"- >- <tbody>- <tr>- <td- style="- padding-left: 22px;- padding-top: 2px;- color: #090909;- font-size: 16px;- font-family: "Inter", sans-serif;- font-weight: 400;- line-height: 1.4;- word-wrap: break-word;- overflow-wrap: break-word;- word-break: break-word;- "- >- {{ notif.body }}- </td>- </tr>- </tbody>- </table>- </a>- {% if !loop.last %}- <hr- style="- border-top: 1px dashed #e0e0e0;- border-bottom: none;- border-right: none;- border-left: none;- margin: 0;- "- />- {% endif %} {% endfor %}-- {% if num_truncated > 0 %}- <div- style="- padding: 12px 17px;- color: #636363;- font-size: 14px;- text-align: center;- font-family: "Inter", sans-serif;- "- >- and {{ num_truncated }} more notification{% if num_truncated != 1 %}s{% endif %}- </div>- {% endif %}-- <hr- style="- border-top: 1px dashed #e0e0e0;- border-bottom: none;- border-right: none;- border-left: none;- margin: 0;- "- />-+ <div+ style="+ display: none;+ max-height: 0;+ overflow: hidden;+ opacity: 0;+ mso-hide: all;+ "+ >+ You have {{ total_count }} new notification{% if total_count != 1 %}s{%+ endif %}.+ </div>+ <table+ role="presentation"+ width="100%"+ cellpadding="0"+ cellspacing="0"+ bgcolor="#f5f5f4"+ style="+ font-family: Arial, Helvetica, sans-serif;+ color: #222222;+ mso-table-lspace: 0pt;+ mso-table-rspace: 0pt;+ "+ >+ <tr>+ <td class="email-page" align="center" style="padding: 48px 20px">+ <!--[if mso]><table role="presentation" width="560" cellpadding="0" cellspacing="0"><tr><td><![endif]--><table- style="- mso-table-lspace: 0pt;- mso-table-rspace: 0pt;- margin-top: 20px;- border: none;- width: 100%;- "+ role="presentation"+ width="100%"cellpadding="0"cellspacing="0"+ style="max-width: 560px; table-layout: fixed">- <tbody>- <tr>- <td style="text-align: center">- <a- style="- font-family: "Inter", sans-serif;- background-color: #ff8f00;- text-decoration: none;- display: inline-block;- white-space: nowrap;- border-radius: 2px;- padding: 8px 48px;- color: #090909;- "- href="https://macro.com"- target="_blank"- >- View in Macro- </a>- </td>- </tr>- </tbody>+ <tr>+ <td+ class="email-content"+ bgcolor="#ffffff"+ style="+ padding: 36px 40px 40px;+ border: 1px solid #e7e7e5;+ border-radius: 12px;+ overflow-wrap: break-word;+ word-wrap: break-word;+ "+ >+ <table+ role="presentation"+ cellpadding="0"+ cellspacing="0"+ style="margin-bottom: 36px"+ >+ <tr>+ <td width="36" style="vertical-align: middle">+ <a href="https://macro.com" style="text-decoration: none"+ ><img+ src="https://static-file-service.macro.com/file/b911aba9-94a6-435c-aa16-8404739f13b0"+ width="36"+ height="36"+ alt="Macro"+ style="+ display: block;+ border: 0;+ background-color: #ffffff;+ -ms-interpolation-mode: bicubic;+ "+ /></a>+ </td>+ </tr>+ </table>+ <h1+ class="email-heading"+ style="+ margin: 0 0 16px;+ font-size: 28px;+ line-height: 36px;+ font-weight: 600;+ letter-spacing: -0.5px;+ color: #222222;+ "+ >+ You have {{ total_count }} new notification{% if total_count != 1 %}s{% endif %}+ </h1>+ <p+ style="+ margin: 0 0 20px;+ font-size: 16px;+ line-height: 26px;+ color: #525252;+ "+ >+ Here's what's been happening.+ </p>+ <table+ role="presentation"+ width="100%"+ cellpadding="0"+ cellspacing="0"+ style="table-layout: fixed; margin-top: 28px"+ >+ {% for notif in notifs %}+ <tr>+ <td style="padding: 20px 0; border-top: 1px solid #e7e7e5">+ <p+ style="+ margin: 0 0 8px;+ color: #737373;+ font-size: 12px;+ line-height: 18px;+ "+ >+ {{ notif.created_at.format("%Y-%m-%d") }}+ </p>+ <h2+ style="+ margin: 0 0 8px;+ font-size: 16px;+ line-height: 24px;+ font-weight: 600;+ "+ >+ <a+ href="https://macro.com"+ style="color: #222222; text-decoration: none"+ >{{ notif.title }}</a+ >+ </h2>+ <p+ style="+ margin: 0;+ color: #525252;+ font-size: 15px;+ line-height: 24px;+ overflow-wrap: break-word;+ word-break: break-word;+ "+ >+ {{ notif.body }}+ </p>+ </td>+ </tr>+ {% endfor %}+ </table>+ {% if num_truncated > 0 %}+ <p+ style="+ margin: 8px 0 0;+ font-size: 14px;+ line-height: 22px;+ color: #737373;+ "+ >+ And {{ num_truncated }} more notification{% if num_truncated+ != 1 %}s{% endif %} in Macro.+ </p>+ {% endif %}+ <table+ role="presentation"+ cellpadding="0"+ cellspacing="0"+ style="margin: 28px 0 8px; max-width: 100%"+ >+ <tr>+ <td+ bgcolor="#222222"+ style="+ border-radius: 6px;+ text-align: center;+ mso-padding-alt: 14px 24px;+ "+ >+ <a+ href="https://macro.com"+ style="+ display: inline-block;+ padding: 14px 24px;+ border: 1px solid #222222;+ border-radius: 6px;+ color: #ffffff;+ background-color: #222222;+ font-size: 15px;+ line-height: 20px;+ font-weight: 600;+ text-decoration: none;+ mso-padding-alt: 0;+ "+ >View in Macro</a+ >+ </td>+ </tr>+ </table>+ </td>+ </tr>+ <tr>+ <td+ style="+ padding: 24px 16px 0;+ text-align: center;+ font-size: 12px;+ line-height: 20px;+ color: #737373;+ "+ >+ You're receiving this because you have new activity in Macro.<br /><a+ href="{{ unsubscribe_url.as_ref() }}"+ style="color: #525252; text-decoration: underline"+ >Unsubscribe from digest emails</a+ >+ </td>+ </tr></table>-- <div- style="- text-align: center;- padding-top: 16px;- font-family: "Inter", sans-serif;- font-size: 12px;- "- >- <a- style="color: #636363; text-decoration: underline"- href="{{ unsubscribe_url.as_ref() }}"- target="_blank"- >- Unsubscribe from digest emails- </a>- </div>- </div>- </div>- </div>+ <!--[if mso]></td></tr></table><![endif]-->+ </td>+ </tr>+ </table></body></html>diff --git a/crates/invite_email/templates/invite.html b/crates/invite_email/templates/invite.htmlindex 393176ca26..91fadb98a6 100644--- a/crates/invite_email/templates/invite.html+++ b/crates/invite_email/templates/invite.html@@ -1,246 +1,241 @@<!doctype html>-<html- xmlns:o="urn:schemas-microsoft-com:office:office"- xmlns:v="urn:schemas-microsoft-com:vml"- xmlns="http://www.w3.org/1999/xhtml"->+<html lang="en" xmlns:o="urn:schemas-microsoft-com:office:office"><head>- <title>You're Invited to Macro</title>- <!--[if !mso]><!-->- <meta http-equiv="X-UA-Compatible" content="IE=edge" />- <!--<![endif]-->- <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />- <meta content="width=device-width, initial-scale=1" name="viewport" />+ <meta charset="utf-8" />+ <meta name="viewport" content="width=device-width, initial-scale=1" />+ <meta name="x-apple-disable-message-reformatting" />+ <meta+ name="format-detection"+ content="telephone=no, date=no, address=no, email=no"+ />+ <meta name="color-scheme" content="light" />+ <meta name="supported-color-schemes" content="light" />+ <title>You're invited to Macro</title><!--[if mso]>- <noscript>- <xml>- <o:OfficeDocumentSettings>- <o:AllowPNG />- <o:PixelsPerInch>96</o:PixelsPerInch>- </o:OfficeDocumentSettings>- </xml>- </noscript>+ <noscript+ ><xml+ ><o:OfficeDocumentSettings+ ><o:PixelsPerInch>96</o:PixelsPerInch+ ><o:AllowPNG /></o:OfficeDocumentSettings></xml+ ></noscript><![endif]-->- <!--[if lte mso 11]>- <style type="text/css">- .mj-outlook-group-fix {- width: 100% !important;+ <style>+ @media screen and (max-width: 600px) {+ .email-page {+ padding: 24px 12px !important;+ }+ .email-content {+ padding: 28px 24px !important;+ }+ .email-heading {+ font-size: 26px !important;+ line-height: 34px !important;}- </style>- <![endif]-->-- <link rel="preconnect" href="https://fonts.googleapis.com">- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>- <link href="https://fonts.googleapis.com/css2?family=Inter:opsz,[email protected],500&display=swap" rel="stylesheet">-- <style type="text/css">- @font-face {- font-family: "Berkeley Mono";- src: url("https://pub-4030931feb3e4212b2ac93166a411ea7.r2.dev/berkley.woff2")- format("woff2");- font-display: fallback;- }-- #outlook a {- padding: 0;- }-- img {- -ms-interpolation-mode: bicubic;- text-decoration: none;- line-height: 100%;- outline: none;- height: auto;- border: 0;}</style></head><bodystyle="+ margin: 0;+ padding: 0;+ width: 100%;+ background-color: #f5f5f4;-webkit-text-size-adjust: 100%;-ms-text-size-adjust: 100%;- word-spacing: normal;- padding: 0;- margin: 0;">- <div style="box-sizing: border-box; padding: 60px 20px; width: 100%">- <div- style="- font-family:- "Berkeley Mono", "Courier New", Courier,- monospace;- background-color: #fcfcfc;- border: 1px solid #e0e0e0;- box-sizing: border-box;- border-radius: 4px;- max-width: 570px;- font-size: 15px;- margin: 0 auto;- overflow: clip;- color: #999;- width: 100%;- "- >- <table- cellpadding="0"- cellspacing="0"- style="- font-family: "Inter", sans-serif;- background-color: #f5f5f5;- color: #090909;- box-sizing: border-box;- font-size: 18px;- padding: 10px 20px;- width: 100%;- border: none;- "- >- <tbody>+ <div+ style="+ display: none;+ max-height: 0;+ overflow: hidden;+ opacity: 0;+ mso-hide: all;+ "+ >+ An invitation to work together on Macro.+ </div>+ <table+ role="presentation"+ width="100%"+ cellpadding="0"+ cellspacing="0"+ bgcolor="#f5f5f4"+ style="+ font-family: Arial, Helvetica, sans-serif;+ color: #222222;+ mso-table-lspace: 0pt;+ mso-table-rspace: 0pt;+ "+ >+ <tr>+ <td class="email-page" align="center" style="padding: 48px 20px">+ <!--[if mso]><table role="presentation" width="560" cellpadding="0" cellspacing="0"><tr><td><![endif]-->+ <table+ role="presentation"+ width="100%"+ cellpadding="0"+ cellspacing="0"+ style="max-width: 560px; table-layout: fixed"+ ><tr>- {% if let Some(url) = sender_profile_picture_url %}<td+ class="email-content"+ bgcolor="#ffffff"style="- vertical-align: middle;- width: 40px;- min-width: 40px;- padding-right: 8px;+ padding: 36px 40px 40px;+ border: 1px solid #e7e7e5;+ border-radius: 12px;+ overflow-wrap: break-word;+ word-wrap: break-word;">- <div- style="- border: 1px solid #e0e0e0;- box-sizing: border-box;- border-radius: 20px;- overflow: clip;- height: 40px;- width: 40px;- "+ <table+ role="presentation"+ cellpadding="0"+ cellspacing="0"+ style="margin-bottom: 36px">- <img- src="{{ url }}"- alt=""- style="- width: 100%;- height: 100%;- object-fit: cover;- display: block;- "- />- </div>- </td>- {% endif %}- <td style="vertical-align: middle; line-height: 1.2">- {% if let Some(name) = sender_name %}{{ name }}{% else %}{% if let Some(email) = sender_email %}<span+ <tr>+ <td width="36" style="vertical-align: middle">+ <a href="https://macro.com" style="text-decoration: none"+ ><img+ src="https://static-file-service.macro.com/file/b911aba9-94a6-435c-aa16-8404739f13b0"+ width="36"+ height="36"+ alt="Macro"+ style="+ display: block;+ border: 0;+ background-color: #ffffff;+ -ms-interpolation-mode: bicubic;+ "+ /></a>+ </td>+ </tr>+ </table>+ <h1+ class="email-heading"style="- color: #626262;- font-family:- "Berkeley Mono", "Courier New",- Courier, monospace;+ margin: 0 0 16px;+ font-size: 28px;+ line-height: 36px;+ font-weight: 600;+ letter-spacing: -0.5px;+ color: #222222;"- ><{{ email }}></span- >{% else %}A Macro user{% endif %}{% endif %} has invited you to Macro- </td>- </tr>- </tbody>- </table>- <hr style="border: none; border-top: 1px dashed #e0e0e0; margin: 0" />- <div style="box-sizing: border-box; padding: 20px">- <div- style="- color: #090909;- font-size: 16px;- font-family: "Inter", sans-serif;- line-height: 1.4;- "- >- {% if let Some(name) = sender_name %}{{ name }}{% if let Some(email) = sender_email %}- <span- style="- color: #626262;- font-family:- "Berkeley Mono", "Courier New", Courier,- monospace;- "- ><{{ email }}></span- >{% endif %}{% else %}{% if let Some(email) = sender_email %}<span- style="- color: #626262;- font-family:- "Berkeley Mono", "Courier New", Courier,- monospace;- "- ><{{ email }}></span- >{% else %}A Macro user{% endif %}{% endif %} has invited you to join them on Macro. Collaborate on- documents. Stay in sync with tasks. Search over everything. AI- Assistance with anything.- </div>-- <table- style="- mso-table-lspace: 0pt;- mso-table-rspace: 0pt;- border: none;- width: 100%;- "- cellpadding="0"- cellspacing="0"- >- <tbody>- <tr>- <td+ >+ Good work starts together.+ </h1>+ {% if let Some(url) = sender_profile_picture_url %}+ <table+ role="presentation"+ cellpadding="0"+ cellspacing="0"+ style="margin: 24px 0 16px"+ >+ <tr>+ <td>+ <img+ src="{{ url }}"+ width="40"+ height="40"+ alt=""+ style="+ display: block;+ border: 0;+ border-radius: 20px;+ object-fit: cover;+ "+ />+ </td>+ </tr>+ </table>+ {% endif %}+ <pstyle="- vertical-align: bottom;- padding: 20px 0 0 0;- width: 50%;+ margin: 0 0 20px;+ font-size: 16px;+ line-height: 26px;+ color: #525252;">- <a- style="- font-family:- "Berkeley Mono", "Courier New",- Courier, monospace;- background-color: #ff8f00;- text-decoration: none;- display: inline-block;- white-space: nowrap;- border-radius: 2px;- width: min-content;- padding: 4px 10px;- color: #090909;- "- href="{{ referral_url() }}"- target="_blank"- >- Join {% if let Some(name) = sender_name %}{{ name }}{% else- %}{% if let Some(email) = sender_email %}{{ email }}{% else %}Macro{% endif %}{% endif %}- </a>- </td>- <td+ {% if let Some(name) = sender_name %}{{ name }}{% if let+ Some(email) = sender_email %} <{{ email }}>{% endif %}{%+ else %}{% if let Some(email) = sender_email %}{{ email }}{%+ else %}A Macro user{% endif %}{% endif %} has invited you to+ join them on Macro.+ </p>+ <pstyle="- vertical-align: top;- text-align: right;- padding: 0;- width: 50%;+ margin: 0 0 20px;+ font-size: 16px;+ line-height: 26px;+ color: #525252;">- <img- src="https://static-file-service.macro.com/file/b911aba9-94a6-435c-aa16-8404739f13b0"- alt="Macro"- style="- -ms-interpolation-mode: bicubic;- line-height: 100%;- outline: none;- width: 60px;- border: 0;- "- />- </td>- </tr>- </tbody>+ Bring your documents, tasks, and conversations together in one+ place.+ </p>+ <table+ role="presentation"+ cellpadding="0"+ cellspacing="0"+ style="margin: 28px 0 8px; max-width: 100%"+ >+ <tr>+ <td+ bgcolor="#222222"+ style="+ border-radius: 6px;+ text-align: center;+ mso-padding-alt: 14px 24px;+ "+ >+ <a+ href="{{ referral_url() }}"+ style="+ display: inline-block;+ padding: 14px 24px;+ border: 1px solid #222222;+ border-radius: 6px;+ color: #ffffff;+ background-color: #222222;+ font-size: 15px;+ line-height: 20px;+ font-weight: 600;+ text-decoration: none;+ mso-padding-alt: 0;+ "+ >Accept invitation</a+ >+ </td>+ </tr>+ </table>+ </td>+ </tr>+ <tr>+ <td+ style="+ padding: 24px 16px 0;+ text-align: center;+ font-size: 12px;+ line-height: 20px;+ color: #737373;+ "+ >+ Need a hand?+ <a+ href="mailto:[email protected]"+ style="color: #525252; text-decoration: underline"+ >Contact support</a+ >+ </td>+ </tr></table>- </div>- </div>- </div>+ <!--[if mso]></td></tr></table><![endif]-->+ </td>+ </tr>+ </table></body></html>diff --git a/crates/invite_email/templates/invite_to_channel.html b/crates/invite_email/templates/invite_to_channel.htmlindex 91205f8328..879e35e596 100644--- a/crates/invite_email/templates/invite_to_channel.html+++ b/crates/invite_email/templates/invite_to_channel.html@@ -1,232 +1,264 @@<!doctype html>-<html- xmlns:o="urn:schemas-microsoft-com:office:office"- xmlns:v="urn:schemas-microsoft-com:vml"- xmlns="http://www.w3.org/1999/xhtml"->+<html lang="en" xmlns:o="urn:schemas-microsoft-com:office:office"><head>- <title>You're Invited to Join #{{ channel_name }} on Macro</title>- <!--[if !mso]><!-->- <meta http-equiv="X-UA-Compatible" content="IE=edge" />- <!--<![endif]-->- <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />- <meta content="width=device-width, initial-scale=1" name="viewport" />+ <meta charset="utf-8" />+ <meta name="viewport" content="width=device-width, initial-scale=1" />+ <meta name="x-apple-disable-message-reformatting" />+ <meta+ name="format-detection"+ content="telephone=no, date=no, address=no, email=no"+ />+ <meta name="color-scheme" content="light" />+ <meta name="supported-color-schemes" content="light" />+ <title>You're invited to join #{{ channel_name }}</title><!--[if mso]>- <noscript>- <xml>- <o:OfficeDocumentSettings>- <o:AllowPNG />- <o:PixelsPerInch>96</o:PixelsPerInch>- </o:OfficeDocumentSettings>- </xml>- </noscript>+ <noscript+ ><xml+ ><o:OfficeDocumentSettings+ ><o:PixelsPerInch>96</o:PixelsPerInch+ ><o:AllowPNG /></o:OfficeDocumentSettings></xml+ ></noscript><![endif]-->- <!--[if lte mso 11]>- <style type="text/css">- .mj-outlook-group-fix {- width: 100% !important;+ <style>+ @media screen and (max-width: 600px) {+ .email-page {+ padding: 24px 12px !important;+ }+ .email-content {+ padding: 28px 24px !important;+ }+ .email-heading {+ font-size: 26px !important;+ line-height: 34px !important;}- </style>- <![endif]-->-- <link rel="preconnect" href="https://fonts.googleapis.com">- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>- <link href="https://fonts.googleapis.com/css2?family=Inter:opsz,[email protected],500&display=swap" rel="stylesheet">-- <style type="text/css">- @font-face {- font-family: "Berkeley Mono";- src: url("https://pub-4030931feb3e4212b2ac93166a411ea7.r2.dev/berkley.woff2")- format("woff2");- font-display: fallback;- }-- #outlook a {- padding: 0;- }-- img {- -ms-interpolation-mode: bicubic;- text-decoration: none;- line-height: 100%;- outline: none;- height: auto;- border: 0;}</style></head><bodystyle="+ margin: 0;+ padding: 0;+ width: 100%;+ background-color: #f5f5f4;-webkit-text-size-adjust: 100%;-ms-text-size-adjust: 100%;- word-spacing: normal;- padding: 0;- margin: 0;">- <div style="box-sizing: border-box; padding: 60px 20px; width: 100%">- <div- style="- font-family:- "Berkeley Mono", "Courier New", Courier,- monospace;- background-color: #fcfcfc;- border: 1px solid #e0e0e0;- box-sizing: border-box;- border-radius: 4px;- max-width: 570px;- font-size: 15px;- margin: 0 auto;- overflow: clip;- color: #999;- width: 100%;- "- >- <table- cellpadding="0"- cellspacing="0"- style="- font-family: "Inter", sans-serif;- background-color: #f5f5f5;- color: #090909;- box-sizing: border-box;- font-size: 18px;- padding: 10px 20px;- width: 100%;- border: none;- "- >- <tbody>+ <div+ style="+ display: none;+ max-height: 0;+ overflow: hidden;+ opacity: 0;+ mso-hide: all;+ "+ >+ An invitation to join a channel on Macro.+ </div>+ <table+ role="presentation"+ width="100%"+ cellpadding="0"+ cellspacing="0"+ bgcolor="#f5f5f4"+ style="+ font-family: Arial, Helvetica, sans-serif;+ color: #222222;+ mso-table-lspace: 0pt;+ mso-table-rspace: 0pt;+ "+ >+ <tr>+ <td class="email-page" align="center" style="padding: 48px 20px">+ <!--[if mso]><table role="presentation" width="560" cellpadding="0" cellspacing="0"><tr><td><![endif]-->+ <table+ role="presentation"+ width="100%"+ cellpadding="0"+ cellspacing="0"+ style="max-width: 560px; table-layout: fixed"+ ><tr>- {% if let Some(url) = sender_profile_picture_url %}<td+ class="email-content"+ bgcolor="#ffffff"style="- vertical-align: middle;- width: 40px;- min-width: 40px;- padding-right: 8px;+ padding: 36px 40px 40px;+ border: 1px solid #e7e7e5;+ border-radius: 12px;+ overflow-wrap: break-word;+ word-wrap: break-word;">- <div- style="- border: 1px solid #e0e0e0;- box-sizing: border-box;- border-radius: 20px;- overflow: clip;- height: 40px;- width: 40px;- "+ <table+ role="presentation"+ cellpadding="0"+ cellspacing="0"+ style="margin-bottom: 36px">- <img- src="{{ url }}"- alt=""- style="- width: 100%;- height: 100%;- object-fit: cover;- display: block;- "- />- </div>- </td>- {% endif %}- <td style="vertical-align: middle; line-height: 1.2">- <span+ <tr>+ <td width="36" style="vertical-align: middle">+ <a href="https://macro.com" style="text-decoration: none"+ ><img+ src="https://static-file-service.macro.com/file/b911aba9-94a6-435c-aa16-8404739f13b0"+ width="36"+ height="36"+ alt="Macro"+ style="+ display: block;+ border: 0;+ background-color: #ffffff;+ -ms-interpolation-mode: bicubic;+ "+ /></a>+ </td>+ </tr>+ </table>+ <h1+ class="email-heading"style="- color: #626262;- font-family:- "Berkeley Mono", "Courier New",- Courier, monospace;+ margin: 0 0 16px;+ font-size: 28px;+ line-height: 36px;+ font-weight: 600;+ letter-spacing: -0.5px;+ color: #222222;"- >{{ sender_display() }}</span- > has invited you to join <strong>#{{ channel_name }}</strong>- </td>- </tr>- </tbody>- </table>- <hr style="border: none; border-top: 1px dashed #e0e0e0; margin: 0" />- <div style="box-sizing: border-box; padding: 20px">- <div- style="- color: #090909;- font-size: 16px;- font-family: "Inter", sans-serif;- line-height: 1.4;- "- >- {% if let Some(content) = message_content %}- {{ content }}- {% else %}- You've been invited to join <strong>#{{ channel_name }}</strong> on Macro.- Collaborate on documents. Stay in sync with tasks. Search over- everything. AI Assistance with anything.- {% endif %}- </div>-- <table- style="- mso-table-lspace: 0pt;- mso-table-rspace: 0pt;- border: none;- width: 100%;- "- cellpadding="0"- cellspacing="0"- >- <tbody>- <tr>- <td+ >+ Join the conversation.+ </h1>+ {% if let Some(url) = sender_profile_picture_url %}+ <table+ role="presentation"+ cellpadding="0"+ cellspacing="0"+ style="margin: 24px 0 16px"+ >+ <tr>+ <td>+ <img+ src="{{ url }}"+ width="40"+ height="40"+ alt=""+ style="+ display: block;+ border: 0;+ border-radius: 20px;+ object-fit: cover;+ "+ />+ </td>+ </tr>+ </table>+ {% endif %}+ <pstyle="- vertical-align: bottom;- padding: 20px 0 0 0;- width: 50%;+ margin: 0 0 20px;+ font-size: 16px;+ line-height: 26px;+ color: #525252;">- <a- style="- font-family:- "Berkeley Mono", "Courier New",- Courier, monospace;- background-color: #ff8f00;- text-decoration: none;- display: inline-block;- white-space: nowrap;- border-radius: 2px;- width: min-content;- padding: 4px 10px;- color: #090909;- "- href="{{ signup_url() }}"- target="_blank"- >- Join #{{ channel_name }}- </a>- </td>- <td+ {{ sender_display() }} has invited you to join+ <strong>#{{ channel_name }}</strong> on Macro.+ </p>+ {% if let Some(content) = message_content %}+ <table+ role="presentation"+ width="100%"+ cellpadding="0"+ cellspacing="0"+ style="table-layout: fixed; margin: 24px 0"+ >+ <tr>+ <td+ style="+ padding: 16px 20px;+ border-left: 2px solid #d4d4d4;+ background-color: #f5f5f4;+ font-size: 16px;+ line-height: 26px;+ color: #525252;+ white-space: pre-line;+ "+ >+ {{- content -}}+ </td>+ </tr>+ </table>+ {% else %}+ <pstyle="- vertical-align: top;- text-align: right;- padding: 0;- width: 50%;+ margin: 0 0 20px;+ font-size: 16px;+ line-height: 26px;+ color: #525252;">- <img- src="https://static-file-service.macro.com/file/b911aba9-94a6-435c-aa16-8404739f13b0"- alt="Macro"- style="- -ms-interpolation-mode: bicubic;- line-height: 100%;- outline: none;- width: 60px;- border: 0;- "- />- </td>- </tr>- </tbody>+ A shared space for your team to talk, share work, and move+ things forward.+ </p>+ {% endif %}+ <table+ role="presentation"+ cellpadding="0"+ cellspacing="0"+ style="margin: 28px 0 8px; max-width: 100%"+ >+ <tr>+ <td+ bgcolor="#222222"+ style="+ border-radius: 6px;+ text-align: center;+ mso-padding-alt: 14px 24px;+ "+ >+ <a+ href="{{ signup_url() }}"+ style="+ display: inline-block;+ padding: 14px 24px;+ border: 1px solid #222222;+ border-radius: 6px;+ color: #ffffff;+ background-color: #222222;+ font-size: 15px;+ line-height: 20px;+ font-weight: 600;+ text-decoration: none;+ mso-padding-alt: 0;+ "+ >Join channel</a+ >+ </td>+ </tr>+ </table>+ </td>+ </tr>+ <tr>+ <td+ style="+ padding: 24px 16px 0;+ text-align: center;+ font-size: 12px;+ line-height: 20px;+ color: #737373;+ "+ >+ Need a hand?+ <a+ href="mailto:[email protected]"+ style="color: #525252; text-decoration: underline"+ >Contact support</a+ >+ </td>+ </tr></table>- </div>- </div>- </div>+ <!--[if mso]></td></tr></table><![endif]-->+ </td>+ </tr>+ </table></body></html>diff --git a/crates/invite_email/templates/invite_to_team.html b/crates/invite_email/templates/invite_to_team.htmlindex 40b5cb58a3..041ca570ae 100644--- a/crates/invite_email/templates/invite_to_team.html+++ b/crates/invite_email/templates/invite_to_team.html@@ -1,221 +1,239 @@<!doctype html>-<html- xmlns:o="urn:schemas-microsoft-com:office:office"- xmlns:v="urn:schemas-microsoft-com:vml"- xmlns="http://www.w3.org/1999/xhtml"->+<html lang="en" xmlns:o="urn:schemas-microsoft-com:office:office"><head>- <title>You're Invited to Join {{ team_name }} on Macro</title>- <!--[if !mso]><!-->- <meta http-equiv="X-UA-Compatible" content="IE=edge" />- <!--<![endif]-->- <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />- <meta content="width=device-width, initial-scale=1" name="viewport" />+ <meta charset="utf-8" />+ <meta name="viewport" content="width=device-width, initial-scale=1" />+ <meta name="x-apple-disable-message-reformatting" />+ <meta+ name="format-detection"+ content="telephone=no, date=no, address=no, email=no"+ />+ <meta name="color-scheme" content="light" />+ <meta name="supported-color-schemes" content="light" />+ <title>You're invited to join {{ team_name }}</title><!--[if mso]>- <noscript>- <xml>- <o:OfficeDocumentSettings>- <o:AllowPNG />- <o:PixelsPerInch>96</o:PixelsPerInch>- </o:OfficeDocumentSettings>- </xml>- </noscript>+ <noscript+ ><xml+ ><o:OfficeDocumentSettings+ ><o:PixelsPerInch>96</o:PixelsPerInch+ ><o:AllowPNG /></o:OfficeDocumentSettings></xml+ ></noscript><![endif]-->- <!--[if lte mso 11]>- <style type="text/css">- .mj-outlook-group-fix {- width: 100% !important;+ <style>+ @media screen and (max-width: 600px) {+ .email-page {+ padding: 24px 12px !important;+ }+ .email-content {+ padding: 28px 24px !important;+ }+ .email-heading {+ font-size: 26px !important;+ line-height: 34px !important;}- </style>- <![endif]-->-- <link rel="preconnect" href="https://fonts.googleapis.com">- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>- <link href="https://fonts.googleapis.com/css2?family=Inter:opsz,[email protected],500&display=swap" rel="stylesheet">-- <style type="text/css">- @font-face {- font-family: "Berkeley Mono";- src: url("https://pub-4030931feb3e4212b2ac93166a411ea7.r2.dev/berkley.woff2")- format("woff2");- font-display: fallback;- }-- #outlook a {- padding: 0;- }-- img {- -ms-interpolation-mode: bicubic;- text-decoration: none;- line-height: 100%;- outline: none;- height: auto;- border: 0;}</style></head><bodystyle="+ margin: 0;+ padding: 0;+ width: 100%;+ background-color: #f5f5f4;-webkit-text-size-adjust: 100%;-ms-text-size-adjust: 100%;- word-spacing: normal;- padding: 0;- margin: 0;">- <div style="box-sizing: border-box; padding: 60px 20px; width: 100%">- <div- style="- font-family:- "Berkeley Mono", "Courier New", Courier,- monospace;- background-color: #fcfcfc;- border: 1px solid #e0e0e0;- box-sizing: border-box;- border-radius: 4px;- max-width: 570px;- font-size: 15px;- margin: 0 auto;- overflow: clip;- color: #999;- width: 100%;- "- >- <table- cellpadding="0"- cellspacing="0"- style="- font-family: "Inter", sans-serif;- background-color: #f5f5f5;- color: #090909;- box-sizing: border-box;- font-size: 18px;- padding: 10px 20px;- width: 100%;- border: none;- "- >- <tbody>+ <div+ style="+ display: none;+ max-height: 0;+ overflow: hidden;+ opacity: 0;+ mso-hide: all;+ "+ >+ An invitation to join a team on Macro.+ </div>+ <table+ role="presentation"+ width="100%"+ cellpadding="0"+ cellspacing="0"+ bgcolor="#f5f5f4"+ style="+ font-family: Arial, Helvetica, sans-serif;+ color: #222222;+ mso-table-lspace: 0pt;+ mso-table-rspace: 0pt;+ "+ >+ <tr>+ <td class="email-page" align="center" style="padding: 48px 20px">+ <!--[if mso]><table role="presentation" width="560" cellpadding="0" cellspacing="0"><tr><td><![endif]-->+ <table+ role="presentation"+ width="100%"+ cellpadding="0"+ cellspacing="0"+ style="max-width: 560px; table-layout: fixed"+ ><tr>- {% if let Some(url) = sender_profile_picture_url %}<td+ class="email-content"+ bgcolor="#ffffff"style="- vertical-align: middle;- width: 40px;- min-width: 40px;- padding-right: 8px;+ padding: 36px 40px 40px;+ border: 1px solid #e7e7e5;+ border-radius: 12px;+ overflow-wrap: break-word;+ word-wrap: break-word;">- <div+ <table+ role="presentation"+ cellpadding="0"+ cellspacing="0"+ style="margin-bottom: 36px"+ >+ <tr>+ <td width="36" style="vertical-align: middle">+ <a href="https://macro.com" style="text-decoration: none"+ ><img+ src="https://static-file-service.macro.com/file/b911aba9-94a6-435c-aa16-8404739f13b0"+ width="36"+ height="36"+ alt="Macro"+ style="+ display: block;+ border: 0;+ background-color: #ffffff;+ -ms-interpolation-mode: bicubic;+ "+ /></a>+ </td>+ </tr>+ </table>+ <h1+ class="email-heading"style="- border: 1px solid #e0e0e0;- box-sizing: border-box;- border-radius: 20px;- overflow: clip;- height: 40px;- width: 40px;+ margin: 0 0 16px;+ font-size: 28px;+ line-height: 36px;+ font-weight: 600;+ letter-spacing: -0.5px;+ color: #222222;">- <img- src="{{ url }}"- alt=""- style="- width: 100%;- height: 100%;- object-fit: cover;- display: block;- "- />- </div>- </td>- {% endif %}- <td style="vertical-align: middle; line-height: 1.2">- {{ invited_by.email_part().as_ref() }} has invited you to the <strong>{{ team_name }}</strong> team- </td>- </tr>- </tbody>- </table>- <hr style="border: none; border-top: 1px dashed #e0e0e0; margin: 0" />- <div style="box-sizing: border-box; padding: 20px">- <div- style="- color: #090909;- font-size: 16px;- font-family: "Inter", sans-serif;- line-height: 1.4;- "- >- You've been invited to join the <strong>{{ team_name }}</strong> team on Macro.{% if let Some(r) = role %}- Your role will be <strong>{{ r }}</strong>.{% endif %}- Collaborate on documents. Stay in sync with tasks. Search over- everything. AI Assistance with anything.- </div>-- <table- style="- mso-table-lspace: 0pt;- mso-table-rspace: 0pt;- border: none;- width: 100%;- "- cellpadding="0"- cellspacing="0"- >- <tbody>- <tr>- <td+ Your team is on Macro.+ </h1>+ {% if let Some(url) = sender_profile_picture_url %}+ <table+ role="presentation"+ cellpadding="0"+ cellspacing="0"+ style="margin: 24px 0 16px"+ >+ <tr>+ <td>+ <img+ src="{{ url }}"+ width="40"+ height="40"+ alt=""+ style="+ display: block;+ border: 0;+ border-radius: 20px;+ object-fit: cover;+ "+ />+ </td>+ </tr>+ </table>+ {% endif %}+ <pstyle="- vertical-align: bottom;- padding: 20px 0 0 0;- width: 50%;+ margin: 0 0 20px;+ font-size: 16px;+ line-height: 26px;+ color: #525252;">- <a- style="- font-family:- "Berkeley Mono", "Courier New",- Courier, monospace;- background-color: #ff8f00;- text-decoration: none;- display: inline-block;- white-space: nowrap;- border-radius: 2px;- width: min-content;- padding: 4px 10px;- color: #090909;- "- href="{{ invite_url() }}"- target="_blank"- >- Join {{ team_name }}- </a>- </td>- <td+ {{ invited_by.email_part().as_ref() }} has invited you to the+ <strong>{{ team_name }}</strong> team.+ </p>+ {% if let Some(r) = role %}+ <pstyle="- vertical-align: top;- text-align: right;- padding: 0;- width: 50%;+ margin: 0 0 20px;+ font-size: 16px;+ line-height: 26px;+ color: #525252;">- <img- src="https://static-file-service.macro.com/file/b911aba9-94a6-435c-aa16-8404739f13b0"- alt="Macro"- style="- -ms-interpolation-mode: bicubic;- line-height: 100%;- outline: none;- width: 60px;- border: 0;- "- />- </td>- </tr>- </tbody>+ Your role will be <strong>{{ r }}</strong>.+ </p>+ {% endif %}+ <table+ role="presentation"+ cellpadding="0"+ cellspacing="0"+ style="margin: 28px 0 8px; max-width: 100%"+ >+ <tr>+ <td+ bgcolor="#222222"+ style="+ border-radius: 6px;+ text-align: center;+ mso-padding-alt: 14px 24px;+ "+ >+ <a+ href="{{ invite_url() }}"+ style="+ display: inline-block;+ padding: 14px 24px;+ border: 1px solid #222222;+ border-radius: 6px;+ color: #ffffff;+ background-color: #222222;+ font-size: 15px;+ line-height: 20px;+ font-weight: 600;+ text-decoration: none;+ mso-padding-alt: 0;+ "+ >Join team</a+ >+ </td>+ </tr>+ </table>+ </td>+ </tr>+ <tr>+ <td+ style="+ padding: 24px 16px 0;+ text-align: center;+ font-size: 12px;+ line-height: 20px;+ color: #737373;+ "+ >+ Need a hand?+ <a+ href="mailto:[email protected]"+ style="color: #525252; text-decoration: underline"+ >Contact support</a+ >+ </td>+ </tr></table>- </div>- </div>- </div>+ <!--[if mso]></td></tr></table><![endif]-->+ </td>+ </tr>+ </table></body></html>diff --git a/crates/ses_client/Cargo.toml b/crates/ses_client/Cargo.tomlindex a2944de10a..eeb14beb89 100644--- a/crates/ses_client/Cargo.toml+++ b/crates/ses_client/Cargo.toml@@ -10,6 +10,7 @@ local = [][dependencies]anyhow = { workspace = true }aws-sdk-sesv2 = { workspace = true }+html-escape = { workspace = true }# Local-mode SMTP delivery (Mailpit). rustls (no native-tls/openssl); the local# transport itself is plaintext via builder_dangerous.lettre = { version = "0.11", default-features = false, features = [diff --git a/crates/ses_client/src/invite_user.rs b/crates/ses_client/src/invite_user.rsindex f8bda7ec5a..3afd2f58b3 100644--- a/crates/ses_client/src/invite_user.rs+++ b/crates/ses_client/src/invite_user.rs@@ -7,163 +7,11 @@ pub(crate) fn build_user_invite_message(org_name: &str, environment: &str) -> St_ => format!("{}.", environment),};- let result = r#"<!DOCTYPE html>-<html lang="en" xmlns:v="urn:schemas-microsoft-com:vml">- <head>- <meta charset="utf-8">- <meta name="x-apple-disable-message-reformatting">- <meta name="viewport" content="width=device-width, initial-scale=1">- <meta name="format-detection" content="telephone=no, date=no, address=no, email=no">- <meta name="color-scheme" content="light dark">- <meta name="supported-color-schemes" content="light dark">- <!--[if mso]>- <noscript>- <xml>- <o:OfficeDocumentSettings- xmlns:o="urn:schemas-microsoft-com:office:office"- >- <o:PixelsPerInch>96</o:PixelsPerInch>- </o:OfficeDocumentSettings>- </xml>- </noscript>- <style>- td,- th,- div,- p,- a,- h1,- h2,- h3,- h4,- h5,- h6 {- font-family: "Segoe UI", sans-serif;- mso-line-height-rule: exactly;- }- </style>- <![endif]-->- <title>Macro Access Code</title>- <style>.hover-text-gray-600:hover {- color: #4b5563 !important- }- @media (max-width: 425px) {- .xs-my-10 {- margin-top: 40px !important;- margin-bottom: 40px !important- }- .xs-py-8 {- padding-top: 32px !important;- padding-bottom: 32px !important- }- .xs-px-6 {- padding-left: 24px !important;- padding-right: 24px !important- }- .xs-py-12 {- padding-top: 48px !important;- padding-bottom: 48px !important- }- .xs-py-10 {- padding-top: 40px !important;- padding-bottom: 40px !important- }- .xs-py-6 {- padding-top: 24px !important;- padding-bottom: 24px !important- }- .xs-text-3xl {- font-size: 30px !important- }- .xs-text-4xl {- font-size: 36px !important- }- .xs-tracking-0_3em {- letter-spacing: 0.3em !important- }- }- .CTA {- text-decoration: none;- padding: 10px 16px;- border-radius: 8px;- color: white !important;- background-color: rgba(14, 165, 233);- font-weight: 500;- }- </style>- </head>- <body style="word-break: break-word; -webkit-font-smoothing: antialiased; margin: 0; width: 100%; background-color: #f9fafb; padding: 0">- <div style="display: none">- To verify your email address, enter this code in the Macro app.- ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏- </div>- <div role="article" aria-roledescription="email" aria-label="Macro Access Code" lang="en">- <table style="width: 100%; font-family: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif" cellpadding="0" cellspacing="0" role="presentation">- <tr>- <td align="center" style="background-color: #f9fafb">- <table style="width: 100%; max-width: 640px; padding-left: 16px; padding-right: 16px" cellpadding="0" cellspacing="0" role="presentation">- <tr>- <td class="xs-py-8 xs-px-6" style="padding: 56px; text-align: center">- <a href="https://macro.com">- <img src="https://coparse-release-artifact-storage-bucket.s3.amazonaws.com/logos/logo.png" width="200" alt="Macro" style="border: 0; max-width: 100%; vertical-align: middle">- </a>- </td>- </tr>- <tr>- <td align="center">- <table style="width: 100%" cellpadding="0" cellspacing="0" role="presentation">- <tr>- <td class="xs-py-12 xs-px-6" style="border-radius: 8px; background-color: #fff; padding-top: 56px; padding-bottom: 56px; padding-left: 40px; padding-right: 40px; outline-style: solid; outline-width: 1px; outline-color: #f3f4f6">- <h1 class="xs-text-3xl" style="margin-top: 0; margin-bottom: 16px; text-align: center; font-size: 36px; font-weight: 600; color: #374151">- Welcome Aboard!- </h1>- <h2 class="xs-text-2xl" style="margin-top: 0; margin-bottom: 64px; text-align: center; font-size: 20px; font-weight: 300; color: #374151">- You've been invited to join {ORG_NAME} on Macro.- </h2>- <p style="text-align: center;">- <a class="CTA" href="https://{PREFIX}macro.com/app/?login=true">Accept Your Invitation</a>- </p>- </td>- </tr>- </table>- </td>- </tr>- <tr>- <td class="xs-py-10" style="padding-top: 48px; padding-bottom: 48px; text-align: center; font-size: 14px; color: #9ca3af">- <p style="margin: 0">- Questions? Email us at- <a href="mailto:[email protected]" class="hover-text-gray-600" style="font-weight: 500; color: #6b7280">[email protected]</a>- </p>- </td>- </tr>- </table>- </td>- </tr>- </table>- </div>- </body>-</html>"#;+ let result = include_str!("../templates/invite_user.html");let result = result.replace("{PREFIX}", prefix.as_str());- result.replace("{ORG_NAME}", org_name)+ result.replace("{ORG_NAME}", &html_escape::encode_text(org_name))}#[cfg(test)]-mod tests {-- #[test]- fn test_build_user_invite_message() {- // let result = build_user_invite_message("prod");- // let expected = "Visit <a href=\"https://macro.com/app?login=true\">Macro</a> to login";- // assert!(result.contains(expected));- //- // let result = build_user_invite_message("staging");- // let expected =- // "Visit <a href=\"https://staging.macro.com/app?login=true\">Macro</a> to login";- // assert!(result.contains(expected));- //- // let result = build_user_invite_message("dev");- // let expected = "Visit <a href=\"https://dev.macro.com/app?login=true\">Macro</a> to login";- // assert!(result.contains(expected));- }-}+mod test;diff --git a/crates/ses_client/src/invite_user/test.rs b/crates/ses_client/src/invite_user/test.rsnew file mode 100644index 0000000000..2e66fc0590--- /dev/null+++ b/crates/ses_client/src/invite_user/test.rs@@ -0,0 +1,26 @@+use super::build_user_invite_message;++#[test]+fn escapes_organization_html() {+ let org_name = "R&D <img src=x onerror=alert(1)> <Partners>";+ let result = build_user_invite_message(org_name, "prod");++ assert!(result.contains(+ "<strong>R&D <img src=x onerror=alert(1)> &lt;Partners&gt;</strong>"+ ));+ assert!(!result.contains(org_name));+}++#[test]+fn preserves_organization_text_and_environment_links() {+ for (environment, prefix) in [("prod", ""), ("staging", "staging."), ("dev", "dev.")] {+ let result = build_user_invite_message("Acme's \"Team\" – 東京", environment);++ assert!(result.contains("<strong>Acme's \"Team\" – 東京</strong>"));+ assert!(result.contains(&format!(+ "href=\"https://{prefix}macro.com/app/?login=true\""+ )));+ assert!(!result.contains("{ORG_NAME}"));+ assert!(!result.contains("{PREFIX}"));+ }+}diff --git a/crates/ses_client/templates/invite_user.html b/crates/ses_client/templates/invite_user.htmlnew file mode 100644index 0000000000..420cac335f--- /dev/null+++ b/crates/ses_client/templates/invite_user.html@@ -0,0 +1,202 @@+<!doctype html>+<html lang="en" xmlns:o="urn:schemas-microsoft-com:office:office">+ <head>+ <meta charset="utf-8" />+ <meta name="viewport" content="width=device-width, initial-scale=1" />+ <meta name="x-apple-disable-message-reformatting" />+ <meta+ name="format-detection"+ content="telephone=no, date=no, address=no, email=no"+ />+ <meta name="color-scheme" content="light" />+ <meta name="supported-color-schemes" content="light" />+ <title>Invitation to Macro</title>+ <!--[if mso]>+ <noscript+ ><xml+ ><o:OfficeDocumentSettings+ ><o:PixelsPerInch>96</o:PixelsPerInch+ ><o:AllowPNG /></o:OfficeDocumentSettings></xml+ ></noscript>+ <![endif]-->+ <style>+ @media screen and (max-width: 600px) {+ .email-page {+ padding: 24px 12px !important;+ }+ .email-content {+ padding: 28px 24px !important;+ }+ .email-heading {+ font-size: 26px !important;+ line-height: 34px !important;+ }+ }+ </style>+ </head>+ <body+ style="+ margin: 0;+ padding: 0;+ width: 100%;+ background-color: #f5f5f4;+ -webkit-text-size-adjust: 100%;+ -ms-text-size-adjust: 100%;+ "+ >+ <div+ style="+ display: none;+ max-height: 0;+ overflow: hidden;+ opacity: 0;+ mso-hide: all;+ "+ >+ You've been invited to join an organization on Macro.+ </div>+ <table+ role="presentation"+ width="100%"+ cellpadding="0"+ cellspacing="0"+ bgcolor="#f5f5f4"+ style="+ font-family: Arial, Helvetica, sans-serif;+ color: #222222;+ mso-table-lspace: 0pt;+ mso-table-rspace: 0pt;+ "+ >+ <tr>+ <td class="email-page" align="center" style="padding: 48px 20px">+ <!--[if mso]><table role="presentation" width="560" cellpadding="0" cellspacing="0"><tr><td><![endif]-->+ <table+ role="presentation"+ width="100%"+ cellpadding="0"+ cellspacing="0"+ style="max-width: 560px; table-layout: fixed"+ >+ <tr>+ <td+ class="email-content"+ bgcolor="#ffffff"+ style="+ padding: 36px 40px 40px;+ border: 1px solid #e7e7e5;+ border-radius: 12px;+ overflow-wrap: break-word;+ word-wrap: break-word;+ "+ >+ <table+ role="presentation"+ cellpadding="0"+ cellspacing="0"+ style="margin-bottom: 36px"+ >+ <tr>+ <td width="36" style="vertical-align: middle">+ <a href="https://macro.com" style="text-decoration: none"+ ><img+ src="https://static-file-service.macro.com/file/b911aba9-94a6-435c-aa16-8404739f13b0"+ width="36"+ height="36"+ alt="Macro"+ style="+ display: block;+ border: 0;+ background-color: #ffffff;+ -ms-interpolation-mode: bicubic;+ "+ /></a>+ </td>+ </tr>+ </table>+ <h1+ class="email-heading"+ style="+ margin: 0 0 16px;+ font-size: 28px;+ line-height: 36px;+ font-weight: 600;+ letter-spacing: -0.5px;+ color: #222222;+ "+ >+ You're invited+ </h1>+ <p+ style="+ margin: 0 0 20px;+ font-size: 16px;+ line-height: 26px;+ color: #525252;+ "+ >+ You've been invited to join <strong>{ORG_NAME}</strong> on+ Macro.+ </p>+ <table+ role="presentation"+ cellpadding="0"+ cellspacing="0"+ style="margin: 28px 0 8px; max-width: 100%"+ >+ <tr>+ <td+ bgcolor="#222222"+ style="+ border-radius: 6px;+ text-align: center;+ mso-padding-alt: 14px 24px;+ "+ >+ <a+ href="https://{PREFIX}macro.com/app/?login=true"+ style="+ display: inline-block;+ padding: 14px 24px;+ border: 1px solid #222222;+ border-radius: 6px;+ color: #ffffff;+ background-color: #222222;+ font-size: 15px;+ line-height: 20px;+ font-weight: 600;+ text-decoration: none;+ mso-padding-alt: 0;+ "+ >Accept invitation</a+ >+ </td>+ </tr>+ </table>+ </td>+ </tr>+ <tr>+ <td+ style="+ padding: 24px 16px 0;+ text-align: center;+ font-size: 12px;+ line-height: 20px;+ color: #737373;+ "+ >+ Need a hand?+ <a+ href="mailto:[email protected]"+ style="color: #525252; text-decoration: underline"+ >Contact support</a+ >+ </td>+ </tr>+ </table>+ <!--[if mso]></td></tr></table><![endif]-->+ </td>+ </tr>+ </table>+ </body>+</html>diff --git a/infra/stacks/fusionauth-instance/templates/email_verification_template.html b/infra/stacks/fusionauth-instance/templates/email_verification_template.htmlindex 51ca708aad..3c5da1aef0 100644--- a/infra/stacks/fusionauth-instance/templates/email_verification_template.html+++ b/infra/stacks/fusionauth-instance/templates/email_verification_template.html@@ -1,135 +1,212 @@[#setting url_escaping_charset="UTF-8"]-<!DOCTYPE html>-<html lang="en" xmlns:v="urn:schemas-microsoft-com:vml">-<head>- <meta charset="utf-8" />- <meta name="x-apple-disable-message-reformatting" />- <meta name="viewport" content="width=device-width, initial-scale=1" />- <meta- name="format-detection"- content="telephone=no, date=no, address=no, email=no"- />- <meta name="color-scheme" content="dark" />- <meta name="supported-color-schemes" content="dark" />- <title>Verify your email</title>- <!--[if mso]><style>body{font-family:Helvetica,Arial,sans-serif}</style><![endif]-->-</head>--<body>-<div- role="article"- aria-roledescription="email"- aria-label="Verify your email"- lang="en"- style="background-color: #030303; width: 100%; font-family: 'Rajdhani', Helvetica, Arial, sans-serif"->- <table- cellpadding="0"- cellspacing="0"- role="presentation"- style="width: 100%; max-width: 640px; margin: 0 auto; background-color: #030303"+<!doctype html>+<html lang="en" xmlns:o="urn:schemas-microsoft-com:office:office">+ <head>+ <meta charset="utf-8" />+ <meta name="viewport" content="width=device-width, initial-scale=1" />+ <meta name="x-apple-disable-message-reformatting" />+ <meta+ name="format-detection"+ content="telephone=no, date=no, address=no, email=no"+ />+ <meta name="color-scheme" content="light" />+ <meta name="supported-color-schemes" content="light" />+ <title>Verify your email</title>+ <!--[if mso]>+ <noscript+ ><xml+ ><o:OfficeDocumentSettings+ ><o:PixelsPerInch>96</o:PixelsPerInch+ ><o:AllowPNG /></o:OfficeDocumentSettings></xml+ ></noscript>+ <![endif]-->+ <style>+ @media screen and (max-width: 600px) {+ .email-page {+ padding: 24px 12px !important;+ }+ .email-content {+ padding: 28px 24px !important;+ }+ .email-heading {+ font-size: 26px !important;+ line-height: 34px !important;+ }+ }+ </style>+ </head>+ <body+ style="+ margin: 0;+ padding: 0;+ width: 100%;+ background-color: #f5f5f4;+ -webkit-text-size-adjust: 100%;+ -ms-text-size-adjust: 100%;+ ">- <tr>- <td align="center" style="padding: 56px 0 32px">- <a href="https://macro.com">- <img- src="https://macro.com/logo-256px.png"- width="128"- alt="Macro"- style="border: 0; max-width: 100%"- />- </a>- </td>- </tr>- <tr>- <td>- <div style="background-color: #090909; border-radius: 5px; padding: 56px 40px; margin: 0 16px; border: 1px solid #484848">- <h1- style="+ <div+ style="+ display: none;+ max-height: 0;+ overflow: hidden;+ opacity: 0;+ mso-hide: all;+ "+ >+ Confirm your email address for Macro.+ </div>+ <table+ role="presentation"+ width="100%"+ cellpadding="0"+ cellspacing="0"+ bgcolor="#f5f5f4"+ style="+ font-family: Arial, Helvetica, sans-serif;+ color: #222222;+ mso-table-lspace: 0pt;+ mso-table-rspace: 0pt;+ "+ >+ <tr>+ <td class="email-page" align="center" style="padding: 48px 20px">+ <!--[if mso]><table role="presentation" width="560" cellpadding="0" cellspacing="0"><tr><td><![endif]-->+ <table+ role="presentation"+ width="100%"+ cellpadding="0"+ cellspacing="0"+ style="max-width: 560px; table-layout: fixed"+ >+ <tr>+ <td+ class="email-content"+ bgcolor="#ffffff"+ style="+ padding: 36px 40px 40px;+ border: 1px solid #e7e7e5;+ border-radius: 12px;+ overflow-wrap: break-word;+ word-wrap: break-word;+ "+ >+ <table+ role="presentation"+ cellpadding="0"+ cellspacing="0"+ style="margin-bottom: 36px"+ >+ <tr>+ <td width="36" style="vertical-align: middle">+ <a href="https://macro.com" style="text-decoration: none"+ ><img+ src="https://macro.com/app/macro-email-logo.png"+ width="36"+ height="36"+ alt="Macro"+ style="+ display: block;+ border: 0;+ background-color: #ffffff;+ -ms-interpolation-mode: bicubic;+ "+ /></a>+ </td>+ </tr>+ </table>+ <h1+ class="email-heading"+ style="margin: 0 0 16px;- text-align: center;- font-size: 36px;- font-weight: 450;- font-family: 'Roboto Slab', Rockwell, Georgia, serif;- letter-spacing: -0.02em;- color: #f2f2f2;+ font-size: 28px;+ line-height: 36px;+ font-weight: 600;+ letter-spacing: -0.5px;+ color: #222222;"- >- Verify your email- </h1>- <p- style="- margin: 0;- text-align: center;+ >+ Verify your email+ </h1>+ <p+ style="+ margin: 0 0 20px;font-size: 16px;- color: #aeaeae;- font-family: 'Rajdhani', Helvetica, Arial, sans-serif;+ line-height: 26px;+ color: #525252;"- >- Click the button below to verify your email address.- </p>- <div style="text-align: center; margin: 56px 0">- <a- href="{{AUTH_SERVICE_URL}}/email/verify/fusionauth/${verificationId}"- style="- display: inline-block;- background-color: #ff8f00;- color: #090909;- text-decoration: none;- padding: 16px 32px;- border-radius: 3px;- font-size: 16px;- font-family: 'Rajdhani', Helvetica, Arial, sans-serif;- font-weight: 600;- "- >- Verify- </a>- </div>- <!--[if mso]>- <table cellpadding="0" cellspacing="0" role="presentation" style="margin: 56px auto;">+ >+ Confirm your email address to continue to Macro.+ </p>+ <table+ role="presentation"+ cellpadding="0"+ cellspacing="0"+ style="margin: 28px 0 8px; max-width: 100%"+ >+ <tr>+ <td+ bgcolor="#222222"+ style="+ border-radius: 6px;+ text-align: center;+ mso-padding-alt: 14px 24px;+ "+ >+ <a+ href="{{AUTH_SERVICE_URL}}/email/verify/fusionauth/${verificationId}"+ style="+ display: inline-block;+ padding: 14px 24px;+ border: 1px solid #222222;+ border-radius: 6px;+ color: #ffffff;+ background-color: #222222;+ font-size: 15px;+ line-height: 20px;+ font-weight: 600;+ text-decoration: none;+ mso-padding-alt: 0;+ "+ >Verify email</a+ >+ </td>+ </tr>+ </table>+ <p+ style="+ margin: 28px 0 0;+ font-size: 14px;+ line-height: 22px;+ color: #737373;+ "+ >+ If you didn't request this, you can safely ignore this email.+ </p>+ </td>+ </tr><tr>- <td style="background-color: #ff8f00; border-radius: 3px;">- <a href="{{AUTH_SERVICE_URL}}/email/verify/fusionauth/${verificationId}" style="color: #090909; text-decoration: none; display: block; padding: 16px 32px; font-size: 16px; font-weight: 600; font-family: 'Rajdhani', Helvetica, Arial, sans-serif;">- Verify Email- </a>+ <td+ style="+ padding: 24px 16px 0;+ text-align: center;+ font-size: 12px;+ line-height: 20px;+ color: #737373;+ "+ >+ Need a hand?+ <a+ href="mailto:[email protected]"+ style="color: #525252; text-decoration: underline"+ >Contact support</a+ ></td></tr></table>- <![endif]-->- <p- style="- text-align: center;- font-size: 16px;- color: #aeaeae;- font-family: 'Rajdhani', Helvetica, Arial, sans-serif;- "- >- If you didn't request this, you can safely ignore this email.- </p>- </div>- </td>- </tr>- <tr>- <td style="padding: 48px 0; text-align: center">- <p- style="- margin: 0;- font-size: 14px;- color: #484848;- font-family: 'Rajdhani', Helvetica, Arial, sans-serif;- "- >- Questions? Email us at- <a- href="mailto:[email protected]"- style="color: #aeaeae; text-decoration: none"- >[email protected]</a- >- </p>- </td>- </tr>- </table>-</div>-</body>+ <!--[if mso]></td></tr></table><![endif]-->+ </td>+ </tr>+ </table>+ </body></html>diff --git a/infra/stacks/fusionauth-instance/templates/passwordless_email_template.html b/infra/stacks/fusionauth-instance/templates/passwordless_email_template.htmlindex d164ea73a6..e0367c6f32 100644--- a/infra/stacks/fusionauth-instance/templates/passwordless_email_template.html+++ b/infra/stacks/fusionauth-instance/templates/passwordless_email_template.html@@ -1,110 +1,204 @@[#setting url_escaping_charset="UTF-8"]-<!DOCTYPE html>-<html lang="en" xmlns:v="urn:schemas-microsoft-com:vml">-<head>- <meta charset="utf-8" />- <meta name="x-apple-disable-message-reformatting" />- <meta name="viewport" content="width=device-width, initial-scale=1" />- <meta- name="format-detection"- content="telephone=no, date=no, address=no, email=no"- />- <meta name="color-scheme" content="dark" />- <meta name="supported-color-schemes" content="dark" />- <title>Macro Access Code</title>- <!--[if mso]><style>body{font-family:Helvetica,Arial,sans-serif}</style><![endif]-->-</head>--<body>-<div- role="article"- aria-roledescription="email"- aria-label="Macro Access Code"- lang="en"- style="background-color: #030303; width: 100%; font-family: 'Rajdhani', Helvetica, Arial, sans-serif"->- <table- cellpadding="0"- cellspacing="0"- role="presentation"- style="width: 100%; max-width: 640px; margin: 0 auto; background-color: #030303"+<!doctype html>+<html lang="en" xmlns:o="urn:schemas-microsoft-com:office:office">+ <head>+ <meta charset="utf-8" />+ <meta name="viewport" content="width=device-width, initial-scale=1" />+ <meta name="x-apple-disable-message-reformatting" />+ <meta+ name="format-detection"+ content="telephone=no, date=no, address=no, email=no"+ />+ <meta name="color-scheme" content="light" />+ <meta name="supported-color-schemes" content="light" />+ <title>Your Macro login code</title>+ <!--[if mso]>+ <noscript+ ><xml+ ><o:OfficeDocumentSettings+ ><o:PixelsPerInch>96</o:PixelsPerInch+ ><o:AllowPNG /></o:OfficeDocumentSettings></xml+ ></noscript>+ <![endif]-->+ <style>+ @media screen and (max-width: 600px) {+ .email-page {+ padding: 24px 12px !important;+ }+ .email-content {+ padding: 28px 24px !important;+ }+ .email-heading {+ font-size: 26px !important;+ line-height: 34px !important;+ }+ }+ </style>+ </head>+ <body+ style="+ margin: 0;+ padding: 0;+ width: 100%;+ background-color: #f5f5f4;+ -webkit-text-size-adjust: 100%;+ -ms-text-size-adjust: 100%;+ ">- <tr>- <td align="center" style="padding: 56px 0 32px">- <a href="https://macro.com">- <img- src="https://macro.com/app/macro-logo-orange.png"- width="96"- height="64"- alt="Macro"- style="border: 0; max-width: 100%"- />- </a>- </td>- </tr>- <tr>- <td>- <div style="background-color: #090909; border-radius: 5px; padding: 56px 40px; margin: 0 16px; border: 1px solid #484848">- <h1- style="+ <div+ style="+ display: none;+ max-height: 0;+ overflow: hidden;+ opacity: 0;+ mso-hide: all;+ "+ >+ Your temporary code to log in to Macro.+ </div>+ <table+ role="presentation"+ width="100%"+ cellpadding="0"+ cellspacing="0"+ bgcolor="#f5f5f4"+ style="+ font-family: Arial, Helvetica, sans-serif;+ color: #222222;+ mso-table-lspace: 0pt;+ mso-table-rspace: 0pt;+ "+ >+ <tr>+ <td class="email-page" align="center" style="padding: 48px 20px">+ <!--[if mso]><table role="presentation" width="560" cellpadding="0" cellspacing="0"><tr><td><![endif]-->+ <table+ role="presentation"+ width="100%"+ cellpadding="0"+ cellspacing="0"+ style="max-width: 560px; table-layout: fixed"+ >+ <tr>+ <td+ class="email-content"+ bgcolor="#ffffff"+ style="+ padding: 36px 40px 40px;+ border: 1px solid #e7e7e5;+ border-radius: 12px;+ overflow-wrap: break-word;+ word-wrap: break-word;+ "+ >+ <table+ role="presentation"+ cellpadding="0"+ cellspacing="0"+ style="margin-bottom: 36px"+ >+ <tr>+ <td width="36" style="vertical-align: middle">+ <a href="https://macro.com" style="text-decoration: none"+ ><img+ src="https://macro.com/app/macro-email-logo.png"+ width="36"+ height="36"+ alt="Macro"+ style="+ display: block;+ border: 0;+ background-color: #ffffff;+ -ms-interpolation-mode: bicubic;+ "+ /></a>+ </td>+ </tr>+ </table>+ <h1+ class="email-heading"+ style="margin: 0 0 16px;- text-align: center;- font-size: 36px;- font-weight: 450;- font-family: 'Roboto Slab', Rockwell, Georgia, serif;- letter-spacing: -0.02em;- color: #f2f2f2;+ font-size: 28px;+ line-height: 36px;+ font-weight: 600;+ letter-spacing: -0.5px;+ color: #222222;"- >- Login to Macro- </h1>- <p- style="- margin: 0;- text-align: center;+ >+ Log in to Macro+ </h1>+ <p+ style="+ margin: 0 0 20px;font-size: 16px;- color: #aeaeae;- font-family: 'Rajdhani', Helvetica, Arial, sans-serif;+ line-height: 26px;+ color: #525252;"- >- Here is your temporary login code.- </p>- <div style="margin: 56px auto; width: calc(100% - 64px); max-width: 400px; border-radius: 5px; background-color: #1f1f1f; padding: 32px; text-align: center; font-size: 48px; letter-spacing: 0.2em; color: #ff8f00; font-family: 'Rajdhani', Helvetica, Arial, sans-serif; border: 1px solid #484848; box-sizing: border-box">- ${code}- </div>- <p- style="- text-align: center;- font-size: 16px;- color: #aeaeae;- font-family: 'Rajdhani', Helvetica, Arial, sans-serif;+ >+ Enter this code to finish logging in.+ </p>+ <table+ role="presentation"+ width="100%"+ cellpadding="0"+ cellspacing="0"+ style="margin: 28px 0; table-layout: fixed"+ >+ <tr>+ <td+ bgcolor="#f5f5f4"+ style="+ padding: 24px 12px;+ border: 1px solid #e7e7e5;+ border-radius: 8px;+ text-align: center;+ font-family: Arial, Helvetica, sans-serif;+ font-size: 32px;+ line-height: 44px;+ font-weight: 600;+ letter-spacing: 5px;+ color: #222222;+ "+ >+ ${code}+ </td>+ </tr>+ </table>+ <p+ style="+ margin: 28px 0 0;+ font-size: 14px;+ line-height: 22px;+ color: #737373;"- >- If you didn't request this, you can safely ignore this email.- </p>- </div>- </td>- </tr>- <tr>- <td style="padding: 48px 0; text-align: center">- <p- style="- margin: 0;- font-size: 14px;- color: #484848;- font-family: 'Rajdhani', Helvetica, Arial, sans-serif;+ >+ If you didn't request this, you can safely ignore this email.+ </p>+ </td>+ </tr>+ <tr>+ <td+ style="+ padding: 24px 16px 0;+ text-align: center;+ font-size: 12px;+ line-height: 20px;+ color: #737373;"- >- Questions? Email us at- <a- href="mailto:[email protected]"- style="color: #aeaeae; text-decoration: none"- >[email protected]</a- >- </p>- </td>- </tr>- </table>-</div>-</body>-</html>\ No newline at end of file+ >+ Need a hand?+ <a+ href="mailto:[email protected]"+ style="color: #525252; text-decoration: underline"+ >Contact support</a+ >+ </td>+ </tr>+ </table>+ <!--[if mso]></td></tr></table><![endif]-->+ </td>+ </tr>+ </table>+ </body>+</html>diff --git a/services/authentication_service/src/api/email/_verify_email_template.html b/services/authentication_service/src/api/email/_verify_email_template.htmlindex 6b75c520cd..026450eb55 100644--- a/services/authentication_service/src/api/email/_verify_email_template.html+++ b/services/authentication_service/src/api/email/_verify_email_template.html@@ -1,211 +1,211 @@-<!DOCTYPE html>-<html lang="en" xmlns:v="urn:schemas-microsoft-com:vml">+<!doctype html>+<html lang="en" xmlns:o="urn:schemas-microsoft-com:office:office"><head><meta charset="utf-8" />- <meta name="x-apple-disable-message-reformatting" /><meta name="viewport" content="width=device-width, initial-scale=1" />+ <meta name="x-apple-disable-message-reformatting" /><metaname="format-detection"content="telephone=no, date=no, address=no, email=no"/>- <meta name="color-scheme" content="light dark" />- <meta name="supported-color-schemes" content="light dark" />- <title>Macro Verify Email</title>+ <meta name="color-scheme" content="light" />+ <meta name="supported-color-schemes" content="light" />+ <title>Verify your email</title>+ <!--[if mso]>+ <noscript+ ><xml+ ><o:OfficeDocumentSettings+ ><o:PixelsPerInch>96</o:PixelsPerInch+ ><o:AllowPNG /></o:OfficeDocumentSettings></xml+ ></noscript>+ <![endif]--><style>- body {- margin: 0;- padding: 0;- width: 100% !important;- background-color: #f9fafb !important;- }- .email-container {- width: 100%;- max-width: 640px;- margin: 0 auto;- background-color: #f9fafb;- }- .content-block {- background-color: #ffffff;- border-radius: 8px;- padding: 56px 40px;- margin: 0 16px;- outline: 1px solid #f3f4f6;- }- .code-display {- margin: 56px auto;- width: calc(100% - 64px);- max-width: 400px;- border-radius: 12px;- background-color: #f3f4f6;- padding: 32px;- text-align: center;- font-size: 48px;- letter-spacing: 0.2em;- color: #374151;- font-family: monospace;- border: 1px solid #e5e7eb;- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);- box-sizing: border-box;- }-- /* Button Styles */- .button-container {- text-align: center;- margin: 40px 0;- }-- .button {- display: inline-block;- background-color: #3b82f6;- color: #ffffff !important;- text-decoration: none !important;- padding: 16px 32px;- border-radius: 8px;- font-size: 16px;- font-weight: 600;- text-align: center;- border: none;- cursor: pointer;- transition: background-color 0.2s ease;- box-shadow: 0 2px 4px rgba(59, 130, 246, 0.15);- min-width: 120px;- }-- .button:hover {- background-color: #2563eb !important;- text-decoration: none !important;- }-- .button:active {- background-color: #1d4ed8 !important;- transform: translateY(1px);- }-- /* Fallback for email clients that don't support CSS3 */- .button-fallback {- background-color: #3b82f6;- border-radius: 8px;- text-align: center;- }-- .button-fallback a {- display: block;- color: #ffffff !important;- text-decoration: none !important;- padding: 16px 32px;- font-size: 16px;- font-weight: 600;- }-- @media (max-width: 425px) {- .content-block {- padding: 32px 16px;- margin: 0 8px;+ @media screen and (max-width: 600px) {+ .email-page {+ padding: 24px 12px !important;}-- .code-display {- width: calc(100% - 32px);- margin: 32px auto;- padding: 24px 16px;- font-size: 32px;+ .email-content {+ padding: 28px 24px !important;}-- .button {- padding: 14px 24px;- font-size: 15px;+ .email-heading {+ font-size: 26px !important;+ line-height: 34px !important;}}</style></head>- <body>+ <body+ style="+ margin: 0;+ padding: 0;+ width: 100%;+ background-color: #f5f5f4;+ -webkit-text-size-adjust: 100%;+ -ms-text-size-adjust: 100%;+ "+ ><div- role="article"- aria-roledescription="email"- aria-label="Macro Veriy Email"- lang="en"+ style="+ display: none;+ max-height: 0;+ overflow: hidden;+ opacity: 0;+ mso-hide: all;+ "+ >+ Confirm your email address for Macro.+ </div>+ <table+ role="presentation"+ width="100%"+ cellpadding="0"+ cellspacing="0"+ bgcolor="#f5f5f4"+ style="+ font-family: Arial, Helvetica, sans-serif;+ color: #222222;+ mso-table-lspace: 0pt;+ mso-table-rspace: 0pt;+ ">- <table- class="email-container"- cellpadding="0"- cellspacing="0"- role="presentation"- >- <tr>- <td align="center" style="padding: 56px 0 32px">- <a href="https://macro.com">- <img- src="https://coparse-release-artifact-storage-bucket.s3.amazonaws.com/logos/logo.png"- width="200"- alt="Macro"- style="border: 0; max-width: 100%"- />- </a>- </td>- </tr>- <tr>- <td>- <div class="content-block">- <h1+ <tr>+ <td class="email-page" align="center" style="padding: 48px 20px">+ <!--[if mso]><table role="presentation" width="560" cellpadding="0" cellspacing="0"><tr><td><![endif]-->+ <table+ role="presentation"+ width="100%"+ cellpadding="0"+ cellspacing="0"+ style="max-width: 560px; table-layout: fixed"+ >+ <tr>+ <td+ class="email-content"+ bgcolor="#ffffff"style="- margin: 0 0 16px;- text-align: center;- font-size: 36px;- font-weight: 600;- color: #374151;+ padding: 36px 40px 40px;+ border: 1px solid #e7e7e5;+ border-radius: 12px;+ overflow-wrap: break-word;+ word-wrap: break-word;">- Verify your email- </h1>- <p+ <table+ role="presentation"+ cellpadding="0"+ cellspacing="0"+ style="margin-bottom: 36px"+ >+ <tr>+ <td width="36" style="vertical-align: middle">+ <a href="https://macro.com" style="text-decoration: none"+ ><img+ src="https://macro.com/app/macro-email-logo.png"+ width="36"+ height="36"+ alt="Macro"+ style="+ display: block;+ border: 0;+ background-color: #ffffff;+ -ms-interpolation-mode: bicubic;+ "+ /></a>+ </td>+ </tr>+ </table>+ <h1+ class="email-heading"+ style="+ margin: 0 0 16px;+ font-size: 28px;+ line-height: 36px;+ font-weight: 600;+ letter-spacing: -0.5px;+ color: #222222;+ "+ >+ Verify your email+ </h1>+ <p+ style="+ margin: 0 0 20px;+ font-size: 16px;+ line-height: 26px;+ color: #525252;+ "+ >+ Confirm your email address to continue to Macro.+ </p>+ <table+ role="presentation"+ cellpadding="0"+ cellspacing="0"+ style="margin: 28px 0 8px; max-width: 100%"+ >+ <tr>+ <td+ bgcolor="#222222"+ style="+ border-radius: 6px;+ text-align: center;+ mso-padding-alt: 14px 24px;+ "+ >+ <a+ href="{{URL}}/email/verify/{{VERIFICATION_ID}}"+ style="+ display: inline-block;+ padding: 14px 24px;+ border: 1px solid #222222;+ border-radius: 6px;+ color: #ffffff;+ background-color: #222222;+ font-size: 15px;+ line-height: 20px;+ font-weight: 600;+ text-decoration: none;+ mso-padding-alt: 0;+ "+ >Verify email</a+ >+ </td>+ </tr>+ </table>+ <p+ style="+ margin: 28px 0 0;+ font-size: 14px;+ line-height: 22px;+ color: #737373;+ "+ >+ If you didn't request this, you can safely ignore this email.+ </p>+ </td>+ </tr>+ <tr>+ <tdstyle="- margin: 0 0 40px;+ padding: 24px 16px 0;text-align: center;- font-size: 16px;- color: #6b7280;+ font-size: 12px;+ line-height: 20px;+ color: #737373;">- Click the button below to verify your email address.- </p>-- <!-- Primary Button (Modern CSS) -->- <div class="button-container">- <a href="{{URL}}/email/verify/{{VERIFICATION_ID}}" class="button">- Verify- </a>- </div>-- <!-- Fallback Button (Table-based for older email clients) -->- <!--[if mso]>- <table cellpadding="0" cellspacing="0" role="presentation" style="margin: 40px auto;">- <tr>- <td class="button-fallback">- <a href="{{URL}}/email/verify/{{VERIFICATION_ID}}" style="color: #ffffff !important; text-decoration: none !important; display: block; padding: 16px 32px; font-size: 16px; font-weight: 600;">- Verify Email Address- </a>- </td>- </tr>- </table>- <![endif]-->-- <p style="text-align: center; font-size: 16px; color: #6b7280; margin: 40px 0 0;">- If you didn't request this, you can safely ignore this email.- </p>- </div>- </td>- </tr>- <tr>- <td style="padding: 48px 0; text-align: center">- <p style="margin: 0; font-size: 14px; color: #9ca3af">- Questions? Email us at- <a- href="mailto:[email protected]"- style="color: #6b7280; font-weight: 500; text-decoration: none"- >[email protected]</a- >- </p>- </td>- </tr>- </table>- </div>+ Need a hand?+ <a+ href="mailto:[email protected]"+ style="color: #525252; text-decoration: underline"+ >Contact support</a+ >+ </td>+ </tr>+ </table>+ <!--[if mso]></td></tr></table><![endif]-->+ </td>+ </tr>+ </table></body></html>diff --git a/services/authentication_service/src/api/merge/_merge_request_template.html b/services/authentication_service/src/api/merge/_merge_request_template.htmlindex 909fb72d9f..d17f76abe8 100644--- a/services/authentication_service/src/api/merge/_merge_request_template.html+++ b/services/authentication_service/src/api/merge/_merge_request_template.html@@ -1,143 +1,204 @@-<!DOCTYPE html>-<html lang="en" xmlns:v="urn:schemas-microsoft-com:vml">+<!doctype html>+<html lang="en" xmlns:o="urn:schemas-microsoft-com:office:office"><head><meta charset="utf-8" />- <meta name="x-apple-disable-message-reformatting" /><meta name="viewport" content="width=device-width, initial-scale=1" />+ <meta name="x-apple-disable-message-reformatting" /><metaname="format-detection"content="telephone=no, date=no, address=no, email=no"/>- <meta name="color-scheme" content="light dark" />- <meta name="supported-color-schemes" content="light dark" />- <title>Macro Account Merge Request</title>+ <meta name="color-scheme" content="light" />+ <meta name="supported-color-schemes" content="light" />+ <title>Merge your Macro accounts</title>+ <!--[if mso]>+ <noscript+ ><xml+ ><o:OfficeDocumentSettings+ ><o:PixelsPerInch>96</o:PixelsPerInch+ ><o:AllowPNG /></o:OfficeDocumentSettings></xml+ ></noscript>+ <![endif]--><style>- body {- margin: 0;- padding: 0;- width: 100% !important;- background-color: #f9fafb !important;- }-- .email-container {- width: 100%;- max-width: 640px;- margin: 0 auto;- background-color: #f9fafb;- }-- .content-block {- background-color: #ffffff;- border-radius: 8px;- padding: 56px 40px;- margin: 0 16px;- outline: 1px solid #f3f4f6;- }-- .code-display {- margin: 56px auto;- width: calc(100% - 64px);- max-width: 400px;- border-radius: 12px;- background-color: #f3f4f6;- padding: 32px;- text-align: center;- font-size: 48px;- letter-spacing: 0.2em;- color: #374151;- font-family: monospace;- border: 1px solid #e5e7eb;- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);- box-sizing: border-box;- }-- @media (max-width: 425px) {- .content-block {- padding: 32px 16px;- margin: 0 8px;+ @media screen and (max-width: 600px) {+ .email-page {+ padding: 24px 12px !important;}-- .code-display {- width: calc(100% - 32px);- margin: 32px auto;- padding: 24px 16px;- font-size: 32px;+ .email-content {+ padding: 28px 24px !important;+ }+ .email-heading {+ font-size: 26px !important;+ line-height: 34px !important;}}</style></head>-- <body>+ <body+ style="+ margin: 0;+ padding: 0;+ width: 100%;+ background-color: #f5f5f4;+ -webkit-text-size-adjust: 100%;+ -ms-text-size-adjust: 100%;+ "+ ><div- role="article"- aria-roledescription="email"- aria-label="Macro Account Merge Request"- lang="en"+ style="+ display: none;+ max-height: 0;+ overflow: hidden;+ opacity: 0;+ mso-hide: all;+ "+ >+ Confirm your account merge request.+ </div>+ <table+ role="presentation"+ width="100%"+ cellpadding="0"+ cellspacing="0"+ bgcolor="#f5f5f4"+ style="+ font-family: Arial, Helvetica, sans-serif;+ color: #222222;+ mso-table-lspace: 0pt;+ mso-table-rspace: 0pt;+ ">- <table- class="email-container"- cellpadding="0"- cellspacing="0"- role="presentation"- >- <tr>- <td align="center" style="padding: 56px 0 32px">- <a href="https://macro.com">- <img- src="https://coparse-release-artifact-storage-bucket.s3.amazonaws.com/logos/logo.png"- width="200"- alt="Macro"- style="border: 0; max-width: 100%"- />- </a>- </td>- </tr>- <tr>- <td>- <div class="content-block">- <h1+ <tr>+ <td class="email-page" align="center" style="padding: 48px 20px">+ <!--[if mso]><table role="presentation" width="560" cellpadding="0" cellspacing="0"><tr><td><![endif]-->+ <table+ role="presentation"+ width="100%"+ cellpadding="0"+ cellspacing="0"+ style="max-width: 560px; table-layout: fixed"+ >+ <tr>+ <td+ class="email-content"+ bgcolor="#ffffff"style="- margin: 0 0 16px;- text-align: center;- font-size: 36px;- font-weight: 600;- color: #374151;+ padding: 36px 40px 40px;+ border: 1px solid #e7e7e5;+ border-radius: 12px;+ overflow-wrap: break-word;+ word-wrap: break-word;">- Account Merge Request- </h1>- <p+ <table+ role="presentation"+ cellpadding="0"+ cellspacing="0"+ style="margin-bottom: 36px"+ >+ <tr>+ <td width="36" style="vertical-align: middle">+ <a href="https://macro.com" style="text-decoration: none"+ ><img+ src="https://macro.com/app/macro-email-logo.png"+ width="36"+ height="36"+ alt="Macro"+ style="+ display: block;+ border: 0;+ background-color: #ffffff;+ -ms-interpolation-mode: bicubic;+ "+ /></a>+ </td>+ </tr>+ </table>+ <h1+ class="email-heading"+ style="+ margin: 0 0 16px;+ font-size: 28px;+ line-height: 36px;+ font-weight: 600;+ letter-spacing: -0.5px;+ color: #222222;+ "+ >+ Merge your accounts+ </h1>+ <p+ style="+ margin: 0 0 20px;+ font-size: 16px;+ line-height: 26px;+ color: #525252;+ "+ >+ {{EMAIL}} has requested to merge your Macro account into+ theirs. To confirm, enter the code below.+ </p>+ <table+ role="presentation"+ width="100%"+ cellpadding="0"+ cellspacing="0"+ style="margin: 28px 0; table-layout: fixed"+ >+ <tr>+ <td+ bgcolor="#f5f5f4"+ style="+ padding: 24px 12px;+ border: 1px solid #e7e7e5;+ border-radius: 8px;+ text-align: center;+ font-family: Arial, Helvetica, sans-serif;+ font-size: 32px;+ line-height: 44px;+ font-weight: 600;+ letter-spacing: 5px;+ color: #222222;+ "+ >+ {{CODE}}+ </td>+ </tr>+ </table>+ <p+ style="+ margin: 28px 0 0;+ font-size: 14px;+ line-height: 22px;+ color: #737373;+ "+ >+ If you didn't request this, you can safely ignore this email.+ </p>+ </td>+ </tr>+ <tr>+ <tdstyle="- margin: 0;+ padding: 24px 16px 0;text-align: center;- font-size: 16px;- color: #6b7280;+ font-size: 12px;+ line-height: 20px;+ color: #737373;">- {{EMAIL}} has requested to merge your macro account into theirs. To do so, enter the code below.- </p>- <div class="code-display">- {{CODE}}- </div>- <p style="text-align: center; font-size: 16px; color: #6b7280">- If you didn't request this, you can safely ignore this email.- </p>- </div>- </td>- </tr>- <tr>- <td style="padding: 48px 0; text-align: center">- <p style="margin: 0; font-size: 14px; color: #9ca3af">- Questions? Email us at- <a- href="mailto:[email protected]"- style="color: #6b7280; font-weight: 500; text-decoration: none"- >[email protected]</a- >- </p>- </td>- </tr>- </table>- </div>+ Need a hand?+ <a+ href="mailto:[email protected]"+ style="color: #525252; text-decoration: underline"+ >Contact support</a+ >+ </td>+ </tr>+ </table>+ <!--[if mso]></td></tr></table><![endif]-->+ </td>+ </tr>+ </table></body></html>