release gate / check (push) Failing after 6m56s
Transactional mail now goes out as the Superbrain HTML design
(internal/mailer/template.html, embedded verbatim) with a plain-text
alternative: multipart/alternative (plain first per RFC 2046), random
boundary, CRLF normalization and SMTP dot-stuffing. Render() fills the
{{placeholders}} with HTML-escaped values and removes optional sections
(CTA + fallback link, note block, footer links, address) when empty;
anchor drift fails the unit tests and degrades to plain text at send
time, never blocking delivery. Password reset gets the headline,
first-name greeting, "Choose a new password" button (Outlook VML
fallback) and expiry/single-use note; notification and agent emails
render title-as-headline with body paragraphs.
The template's footer links are now real pages:
- /help: public help center (10 topic sections + FAQ accordion), linked
from the login page.
- /unsubscribe?token=...: public confirmation page; the HMAC-signed user
id (notify.UnsubscribeToken, domain-separated, stable, no stored row)
IS the credential. POST /api/notifications/unsubscribe accepts the
RFC 8058 one-click shape (token in query, form body ignored) and the
browser JSON shape; it disables the user's enabled email channels and
pauses enabled agent email tasks addressed to their own email
(idempotent, re-enableable, per-client rate limited, audit logged).
- Email preferences deep-links to /settings?tab=notifications; Settings
now honors ?tab=<section> (unknown values fall back to profile).
notify.FooterLinks is the single eligibility point: preferences + help
whenever NEXTAUTH_URL is set; unsubscribe ONLY when the recipient is the
owner's own account email — third-party channel addresses and agent
recipients never receive a link that changes someone else's settings,
and transactional mail (password reset) never carries unsubscribe.
Owner-addressed mail also carries List-Unsubscribe +
List-Unsubscribe-Post headers.
Verified: Go build/vet/unit green; new TestUnsubscribeFlow integration
test pins footer + headers, blast radius (slack channel and third-party
task survive), one-click + JSON paths, idempotence, tampered tokens and
the third-party/transactional exclusions; notifications, phase-2,
password-reset and agent suites green; web lint/SSR-lint/build 0 errors;
full browser regressions pass; live smoke of /help, /unsubscribe states,
the settings deep-link auth gate and bad-token 400 through the proxy.
171 lines
8.8 KiB
HTML
171 lines
8.8 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" 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="color-scheme" content="light dark">
|
|
<meta name="supported-color-schemes" content="light dark">
|
|
<title>{{subject}}</title>
|
|
<!--[if mso]>
|
|
<noscript><xml><o:OfficeDocumentSettings><o:PixelsPerInch>96</o:PixelsPerInch></o:OfficeDocumentSettings></xml></noscript>
|
|
<style>td,th,div,p,a,h1,span{font-family:Arial,Helvetica,sans-serif !important;}</style>
|
|
<![endif]-->
|
|
<link href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:wght@500;700&display=swap" rel="stylesheet">
|
|
<style>
|
|
body, table, td, a { -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; }
|
|
table, td { mso-table-lspace: 0pt; mso-table-rspace: 0pt; }
|
|
img { border: 0; outline: none; text-decoration: none; -ms-interpolation-mode: bicubic; }
|
|
body { margin: 0 !important; padding: 0 !important; width: 100% !important; }
|
|
a[x-apple-data-detectors] { color: inherit !important; text-decoration: none !important; }
|
|
|
|
@media screen and (max-width: 620px) {
|
|
.container { width: 100% !important; }
|
|
.px { padding-left: 24px !important; padding-right: 24px !important; }
|
|
.headline { font-size: 28px !important; line-height: 34px !important; }
|
|
.btn a { display: block !important; }
|
|
}
|
|
|
|
/* Dark mode (Apple Mail, iOS Mail, Outlook for Mac/iOS, some Android clients) */
|
|
@media (prefers-color-scheme: dark) {
|
|
.bg-outer { background-color: #0E1024 !important; }
|
|
.bg-card { background-color: #181B36 !important; }
|
|
.bg-note { background-color: #22264A !important; }
|
|
.t-ink { color: #ECEDF8 !important; }
|
|
.t-muted { color: #A3A7C9 !important; }
|
|
.t-accent { color: #9AA4FF !important; }
|
|
.rule { border-color: #2C3060 !important; }
|
|
}
|
|
[data-ogsc] .bg-outer { background-color: #0E1024 !important; }
|
|
[data-ogsc] .bg-card { background-color: #181B36 !important; }
|
|
[data-ogsc] .bg-note { background-color: #22264A !important; }
|
|
[data-ogsc] .t-ink { color: #ECEDF8 !important; }
|
|
[data-ogsc] .t-muted { color: #A3A7C9 !important; }
|
|
[data-ogsc] .t-accent { color: #9AA4FF !important; }
|
|
</style>
|
|
</head>
|
|
<body class="bg-outer" style="margin:0; padding:0; background-color:#ECEEF6;">
|
|
|
|
<!-- Preheader: the preview line shown in the inbox. Keep it under ~90 characters. -->
|
|
<div style="display:none; max-height:0; overflow:hidden; mso-hide:all; font-size:1px; line-height:1px; color:#ECEEF6; opacity:0;">
|
|
{{preheader_text}}͏‌ ͏‌ ͏‌ ͏‌ ͏‌
|
|
</div>
|
|
|
|
<table role="presentation" class="bg-outer" width="100%" cellpadding="0" cellspacing="0" border="0" style="background-color:#ECEEF6;">
|
|
<tr>
|
|
<td align="center" style="padding:40px 12px;">
|
|
|
|
<table role="presentation" class="container" width="600" cellpadding="0" cellspacing="0" border="0" style="width:600px; max-width:600px;">
|
|
|
|
<!-- Wordmark -->
|
|
<tr>
|
|
<td class="px" style="padding:0 40px 20px 40px;">
|
|
<table role="presentation" cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td width="14" height="14" style="width:14px; height:14px; background-color:#3646E8; border-radius:7px; font-size:0; line-height:0;"> </td>
|
|
<td width="6" style="font-size:0;"> </td>
|
|
<td width="8" height="8" style="width:8px; height:8px; background-color:#9AA4FF; border-radius:4px; font-size:0; line-height:0;"> </td>
|
|
<td style="padding-left:10px; font-family:'Bricolage Grotesque', Arial, Helvetica, sans-serif; font-size:20px; font-weight:700; letter-spacing:-0.3px; color:#1A1D3A;" class="t-ink">
|
|
superbrain
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
|
|
<!-- Card -->
|
|
<tr>
|
|
<td class="bg-card" style="background-color:#FFFFFF; border-radius:16px; border-top:6px solid #3646E8;">
|
|
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0">
|
|
|
|
<!-- Headline -->
|
|
<tr>
|
|
<td class="px" style="padding:44px 48px 12px 48px;">
|
|
<h1 class="headline t-ink" style="margin:0; font-family:'Bricolage Grotesque', Arial, Helvetica, sans-serif; font-size:34px; line-height:40px; font-weight:700; letter-spacing:-0.8px; color:#1A1D3A;">
|
|
{{headline}}
|
|
</h1>
|
|
</td>
|
|
</tr>
|
|
|
|
<!-- Body -->
|
|
<tr>
|
|
<td class="px t-ink" style="padding:12px 48px 0 48px; font-family:Arial, Helvetica, sans-serif; font-size:16px; line-height:26px; color:#2E3254;">
|
|
<p style="margin:0 0 16px 0;">Hi {{first_name}},</p>
|
|
<p style="margin:0 0 16px 0;">{{body_paragraph_1}}</p>
|
|
<p style="margin:0;">{{body_paragraph_2}}</p>
|
|
</td>
|
|
</tr>
|
|
|
|
<!-- Button (bulletproof, with Outlook fallback) -->
|
|
<tr>
|
|
<td class="px btn" style="padding:32px 48px 8px 48px;">
|
|
<!--[if mso]>
|
|
<v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" href="{{cta_url}}" style="height:50px; v-text-anchor:middle; width:240px;" arcsize="20%" stroke="f" fillcolor="#3646E8">
|
|
<w:anchorlock/>
|
|
<center style="color:#ffffff; font-family:Arial,sans-serif; font-size:16px; font-weight:bold;">{{cta_label}}</center>
|
|
</v:roundrect>
|
|
<![endif]-->
|
|
<!--[if !mso]><!-->
|
|
<a href="{{cta_url}}" style="display:inline-block; background-color:#3646E8; color:#FFFFFF; font-family:Arial, Helvetica, sans-serif; font-size:16px; font-weight:700; line-height:50px; text-align:center; text-decoration:none; padding:0 32px; border-radius:10px;">
|
|
{{cta_label}}
|
|
</a>
|
|
<!--<![endif]-->
|
|
</td>
|
|
</tr>
|
|
|
|
<!-- Fallback link -->
|
|
<tr>
|
|
<td class="px t-muted" style="padding:12px 48px 0 48px; font-family:Arial, Helvetica, sans-serif; font-size:13px; line-height:20px; color:#6A6F92;">
|
|
If the button doesn't work, paste this link into your browser:<br>
|
|
<a href="{{cta_url}}" class="t-accent" style="color:#3646E8; word-break:break-all;">{{cta_url}}</a>
|
|
</td>
|
|
</tr>
|
|
|
|
<!-- Note block (optional — delete this row if not needed) -->
|
|
<tr>
|
|
<td class="px" style="padding:32px 48px 0 48px;">
|
|
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="bg-note t-ink" style="background-color:#EEF0FF; border-radius:10px; padding:18px 20px; font-family:Arial, Helvetica, sans-serif; font-size:14px; line-height:22px; color:#2E3254;">
|
|
{{note_text}}
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
|
|
<!-- Sign-off -->
|
|
<tr>
|
|
<td class="px t-ink" style="padding:32px 48px 44px 48px; font-family:Arial, Helvetica, sans-serif; font-size:16px; line-height:26px; color:#2E3254;">
|
|
{{sign_off}}<br>
|
|
The Superbrain team
|
|
</td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
|
|
<!-- Footer -->
|
|
<tr>
|
|
<td class="px t-muted" style="padding:28px 48px 0 48px; font-family:Arial, Helvetica, sans-serif; font-size:12px; line-height:19px; color:#6A6F92;">
|
|
<p style="margin:0 0 8px 0;">You're receiving this email because you have a Superbrain account.</p>
|
|
<p style="margin:0 0 8px 0;">
|
|
<a href="{{preferences_url}}" class="t-accent" style="color:#3646E8; text-decoration:underline;">Email preferences</a>
|
|
|
|
|
<a href="{{unsubscribe_url}}" class="t-accent" style="color:#3646E8; text-decoration:underline;">Unsubscribe</a>
|
|
|
|
|
<a href="{{help_url}}" class="t-accent" style="color:#3646E8; text-decoration:underline;">Help center</a>
|
|
</p>
|
|
<p style="margin:0;">Superbrain, {{company_address}}</p>
|
|
</td>
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</body>
|
|
</html>
|