pkg/email by naming a published Resend
template and its variables. The template content is authored in this repo as
react-email components in web/internal/resend/emails/ and uploaded to
Resend by web/internal/resend/scripts/sync-templates.tsx. Copy or design
changes are TypeScript edits plus one command, no Go deploy.
Without a RESEND_API_KEY, pkg/email falls back to a noop sender that only
logs, so local and CI never send real mail.
Editing an email
Edit the component inweb/internal/resend/emails/, then:
Publishing
dev/.env.resend locally (see dev/.env.resend.example).
Adding a new email
Write the component with string props for every dynamic value, then register it in thetemplates array in scripts/sync-templates.tsx: alias, name,
subject, from, the element with {{{VARIABLE}}} placeholder props, and the
variable declarations with fallbacks. Include a Preview component for the
inbox snippet.
Do not rename an alias a deployed service sends with, and keep the variable
keys identical to the map the Go caller passes; Resend rejects sends with
missing variables.
Set Email.IdempotencyKey when a caller may retry after a transient failure
(e.g. a Restate handler re-invocation). Resend dedupes identical sends for 24
hours. Use a stable key per logical message, such as
budget-alert/{workspace_id}:{period}.
