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
This adapter implements a Pay-inspired four-rung override ladder:
- 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}). - 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
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.