fix(email): make the welcome email unsubscribable via a Resend automation
Merged
SA
2mo ago+30+30+01234567890123456789-12-12-01234567890123456789
Problem
The welcome email was a direct resend.emails.send() from the signup hook. Resend adds no unsubscribe link and no List-Unsubscribe headers to direct sends: {{{RESEND_UNSUBSCRIBE_URL}}} is only filled in for broadcasts and automations. A new signup had to reply to support@ to be removed (CAN-SPAM and deliverability problem).
Change
- The signup hook emits
user.welcomefor every signup instead of sending the email. It stays unconditional in both A/B arms. It is a new event becauseuser.signed_upis withheld from the control arm. sync-automations.tsdefines awelcomeautomation:user.welcome→ send theactivation-00-welcometemplate.00-welcome.tsxacceptsunsubscribeUrl, the same as01-first-agent. The published template was rendered withunsubscribeUrl="{{{RESEND_UNSUBSCRIBE_URL}}}".
Already live in Resend (safe before deploy: nothing emits user.welcome until this merges)
- Template
activation-00-welcome(d9966fba-…) published: fromSuperset <noreply@superset.sh>, subjectWelcome to Superset, reply-tosupport@superset.sh. - Automation
welcome(01a0cb8b-2688-…) created and enabled.sync-automations.tsdry run reports it up to date.
Verification
- Fired
user.welcomefor two test addresses; both emails delivered. - The raw MIME of the satya@superset.sh copy has
List-Unsubscribe: <https://unsubscribe.resend.com/?token=…>andList-Unsubscribe-Post: List-Unsubscribe=One-Click, and the footer shows an Unsubscribe link to the same URL. DKIM, SPF and DMARC pass. - The event created the Resend contact for an address that had none. This matters for control-arm users, who previously never became contacts.
bun run lint, typecheck (auth, email, api), and tests (auth, email) pass.
Notes
- The footer no longer says "This email was sent to ". That matches the live drip templates.
- Welcome delivery now depends on the
welcomeautomation staying enabled. - Unrelated drift: the sync dry run wants to replace
pro-cancellation-feedback, because the live automation no longer matches the script. I did not apply it.
Summary by cubic
Switches the welcome email from a direct send to a Resend automation so new signups get an unsubscribe link and List-Unsubscribe headers. Direct sends carry neither, so users had to email support to be removed.
- The signup hook now emits
user.welcomefor every signup (both A/B arms) instead of sending the email. - The
welcomeautomation sends theactivation-00-welcometemplate, which now acceptsunsubscribeUrl. - The footer no longer shows the recipient's address, matching the live drip templates.
Summary by CodeRabbit
- New Features
- Welcome emails are now delivered through an automated email workflow.
- Welcome messages include unsubscribe options and standard list-unsubscribe headers.
- The welcome email template now supports personalized unsubscribe links.
- Welcome email delivery remains consistent across signup experience variants.
- Improvements
- Welcome email delivery can now be managed centrally through the email automation system.