1.2 KiB · text History fb64a1a

Vigil’s mail templates

Pushed to mail-prism at boot by MailPrism.TemplateSync (see Vigil.Application) when the mailer is MailPrism.SwooshAdapter. Edit them here; edits made in mail-prism’s admin UI are overwritten by the next sync.

One template = files sharing a slug: <slug>.subject (required), <slug>.html, <slug>.txt, and <slug>.json (the sample context: it must define every variable the template uses, since mail-prism renders each one against it at sync time and refuses the whole set if one fails).

minijinja (Jinja2) syntax. layout.* is the shared frame; the others {% extends %} it.

slug sent by context
magic-link UserNotifier.deliver_login_instructions/2 (confirmed user) email, url
confirm-account UserNotifier.deliver_login_instructions/2 (unconfirmed user) email, url
update-email UserNotifier.deliver_update_email_instructions/2 email, url

The notifier still builds the plain-text body itself, for the dev mailbox, tests and the SMTP and log providers; keep the two in step.

Alert emails (Vigil.Alerts.Email) aren’t templates: they’re built per alert and go through mail-prism as raw sends (subject, text, HTML).