feat(email): every email Minstrel sends uses one layout (#8150)

The password reset, the new-music and activity summaries and the SMTP
test message each drew their own page; the test message had no layout
at all. They now share internal/mailer's layout: the Minstrel name at
the top, the email's heading and message on a card in the design
system's dark theme, and a footer saying which server sent it and why,
signed "— Minstrel", with the notification-settings link on the
summaries. A plain-text body in the same frame goes alongside.

An email supplies only its content templates and a Frame (heading,
server, reason). Links, buttons and quiet text take named styles from
the layout ({{style "link"}}), so colours change in one place; an
unknown style name fails the render. The SMTP test message is a
template now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-27 10:27:16 -05:00
co-authored by Claude Opus 5.5
parent a18d5aaa11
commit bae3421057
14 changed files with 331 additions and 113 deletions
+29
View File
@@ -0,0 +1,29 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="color-scheme" content="dark">
<meta name="supported-color-schemes" content="dark">
</head>
<body style="{{style "page"}}">
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="{{style "wrap"}}">
<tr><td align="center" style="padding:32px 16px;">
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="max-width:560px;">
<tr><td style="{{style "brand"}}">Minstrel</td></tr>
<tr><td style="{{style "card"}}">
<h1 style="{{style "heading"}}">{{.Frame.Heading}}</h1>
{{template "content" .Content}}
</td></tr>
<tr><td style="{{style "footer"}}">
Sent by {{.Frame.ServerName}} because {{.Frame.Reason}}.<br>
{{- if .Frame.NotificationSettings}}
{{with .Frame.SettingsURL}}<a href="{{.}}" style="{{style "faint"}}">Choose which notifications are emailed to you</a>{{else}}Choose which notifications are emailed to you in Minstrel, under Settings → Notifications.{{end}}<br>
{{- end}}
— Minstrel
</td></tr>
</table>
</td></tr>
</table>
</body>
</html>
+9
View File
@@ -0,0 +1,9 @@
{{.Frame.Heading}}
{{template "content" .Content}}
--
Sent by {{.Frame.ServerName}} because {{.Frame.Reason}}.
{{- if .Frame.NotificationSettings}}
{{with .Frame.SettingsURL}}Choose which notifications are emailed to you: {{.}}{{else}}Choose which notifications are emailed to you in Minstrel, under Settings → Notifications.{{end}}
{{- end}}
— Minstrel
+7 -29
View File
@@ -1,29 +1,7 @@
<!doctype html>
<html>
<body style="font-family: -apple-system, system-ui, sans-serif; max-width: 560px; margin: 0 auto; padding: 24px; color: #2c2c2c;">
<p>Hello <strong>{{.Username}}</strong>,</p>
<p>A password reset was requested for your Minstrel account. To set a new
password, click the button below within <strong>{{.ExpiryHours}}</strong> hours:</p>
<p style="margin: 24px 0;">
<a href="{{.ResetURL}}" style="display: inline-block; padding: 12px 24px;
background: #4a6b5c; color: #ffffff; text-decoration: none; border-radius: 6px;
font-weight: 500;">Reset password</a>
</p>
<p style="font-size: 14px; color: #666;">
Or copy this URL into your browser:<br>
<code style="word-break: break-all;">{{.ResetURL}}</code>
</p>
<p style="font-size: 14px; color: #666;">
If you didn't request this, you can safely ignore this email — your
password won't change.
</p>
<p style="font-size: 12px; color: #999; margin-top: 32px; border-top: 1px solid #eee; padding-top: 16px;">
— Minstrel
</p>
</body>
</html>
<p style="{{style "p"}}">Hello <strong>{{.Username}}</strong>,</p>
<p style="{{style "p"}}">A password reset was requested for your Minstrel account. To set a new
password, use the button below within <strong>{{.ExpiryHours}}</strong> hours.</p>
<p style="margin:24px 0;"><a href="{{.ResetURL}}" style="{{style "button"}}">Reset password</a></p>
<p style="{{style "p"}} {{style "quiet"}}">Or copy this address into your browser:<br>
<span style="{{style "code"}}">{{.ResetURL}}</span></p>
<p style="margin:0; {{style "quiet"}}">If you didn't ask for this, you can ignore this email. Your password won't change.</p>
+2 -4
View File
@@ -5,7 +5,5 @@ password, follow this link within {{.ExpiryHours}} hours:
{{.ResetURL}}
If you didn't request this, you can safely ignore this email — your
password won't change.
— Minstrel
If you didn't ask for this, you can ignore this email. Your password
won't change.
+2
View File
@@ -0,0 +1,2 @@
<p style="{{style "p"}}">This is a test message from your Minstrel server.</p>
<p style="margin:0;">It arrived, so the server's email settings work: password resets and the notification emails people choose will reach their inboxes.</p>
+4
View File
@@ -0,0 +1,4 @@
This is a test message from your Minstrel server.
It arrived, so the server's email settings work: password resets and the
notification emails people choose will reach their inboxes.