Andrey Antukh 9234e829d9
✨ Render email templates inside the mail job (#12448)
* ✨ Render email templates inside the mail job

The web process rendered each email to full subject and HTML body
before submitting it, so every queued job carried a huge params
payload. The queue now stores only the template id plus the raw
template data, and the new :send-templated-mail job renders and
sends the email inside the worker.

The old :sendmail job stays in place to drain jobs submitted in the
previous format; the quota notice and the REPL test mail keep using
it. All templated callers (auth, profile, feedback, invitations,
comments, Nitrate) submit recipes through eml/send-template.

Closes #12445

AI-assisted-by: muse-spark-1.3-contributor

* ♻️ Unify templated mail on template id strings

The ::eml/template value was a namespaced keyword whose name had to
match the registry key, with one live mismatch (user-feedback vs
feedback). Callers now pass the registry id string itself, so keys
stay ::eml/-namespaced and values stay plain data, and the single
templates set rejects unsendable mail both at submit and in the
worker.

Closes #12445

AI-assisted-by: muse-spark-1.3-contributor

* 🐛 Encode templated mail data with the template schema

The job params column is plain JSON, so the URIs of an organization
(:logo, :avatar-bg-url) were stored as record maps and the template
check rejected them in the worker. Invites for organization teams,
organization invites and renewal notices failed without a retry.

Each registry entry now carries the JSON encoder and decoder of its
template schema: send-template encodes the data before submit and the
worker decodes it before rendering. The job schema keeps only the mail
envelope, as the template schemas own the typed data.

Closes #12445

AI-assisted-by: claude-opus-5-5

---------
2026-11-05 17:46:48 +01:00
..
2026-10-07 10:41:29 +02:00
2026-10-29 15:43:06 +01:00
2024-05-29 19:05:04 +02:00