1.3 KiB · text History e0979f3

recourse mail templates

Compiled into the binary (src/mailer.rs, TEMPLATE_FILES) and pushed to mail-prism (PUT /api/v1/templates, prune: true) when the webservice starts with MAIL_PRISM_URL and MAIL_PRISM_API_KEY set. Edit them here; edits made in mail-prism’s admin UI are overwritten by the next sync. A new template needs its files here and a line in TEMPLATE_FILES.

One template = files sharing a slug: <slug>.subject, <slug>.html, <slug>.txt, and <slug>.json, the sample context. mail-prism renders every template against its sample at sync time and refuses the whole set if one fails, so the sample must define every variable the template uses (_name / _description are for mail-prism’s admin UI and aren’t variables).

minijinja (Jinja2) syntax; the HTML part is autoescaped. layout.* is the shared frame the others extend.

slug sent by context
verify-email registration; “Resend” on the profile / banner; manage user resend-verification site_name, username, url, ttl_hours

Each message also carries a plain-text rendering (src/mailer.rs) for the log transport used when mail-prism isn’t configured (development: the link shows up in the webservice log); keep the two in step. A test there checks each message’s context against its template’s sample.