Default Accrue.Mailer adapter — enqueues an Oban job on the
:accrue_mailers queue that a worker later turns into a delivered email.
Pay-style override ladder (D-23)
This adapter documents the Pay-inspired four-rung override ladder but Phase 1 implements only rungs 1 and 3. The full catalog lands in Phase 6.
- Kill switch (
:emailsconfig) —Accrue.Mailer.deliver/2short-circuits before this adapter is reached. Handled at the behaviour layer. - MFA conditional (
:emailsvalue is{Mod, :fun, args}) — Phase 6. - Template module override (
:email_overridesconfig) — resolved inAccrue.Workers.Mailer.resolve_template/1. - Full pipeline replace (
:mailerconfig pointing at a custom module) — already supported viaAccrue.Mailer.impl/0.
Oban args safety (D-27, Pitfall #5, T-MAIL-01)
Oban persists job args as JSONB. The assigns map MUST contain only
scalars (no structs, pids, functions, refs) so a worker crash mid-job
doesn't corrupt the queue and so sensitive structs don't leak into the
oban_jobs table. only_scalars!/1 walks the map and raises
ArgumentError on any non-primitive value. The convention is:
pass entity IDs, not entity structs. The worker rehydrates at
delivery time.
Summary
Functions
Walks map and raises ArgumentError if any value is not
Oban-JSON-safe. Returns the map unchanged on success.
Functions
Walks map and raises ArgumentError if any value is not
Oban-JSON-safe. Returns the map unchanged on success.
Allowed leaf types: nil, atom, binary, number, boolean. Maps and
lists are recursed.