OptionalannounceWhether each delivery is announced on the event bus.
notification.delivered and notification.failed, carrying the notice, the channel and the
outcome. On by default when a bus is enabled, and it is how an application keeps the delivery
ledger it wants: this module records nothing, because a ledger belongs to whoever answers
"why did they never receive it".
OptionalattemptsHow many times a queued delivery is retried. Defaults to what the queue does.
OptionalchannelsThe channels this application configures.
OptionaldedupeHow a repeated occurrence is recognised.
Keys are held in @stone-js/cache, so the store is the one the application already chose, and
this module stores nothing of its own. Without the cache module, deduplication does not happen
and says so once: silently sending twice is the failure it exists to prevent.
Optionalstore?: stringWhich cache store holds them. Defaults to the application's default store.
Optionalttl?: numberHow long a key is remembered, in seconds. Defaults to a day.
OptionaldefaultThe channels a notification uses when it names none.
Defaults to ['log'], which delivers nothing and says so on first use. That is deliberate: a
default that quietly sent real mail would send it from the first test run.
OptionaldispatchWhether delivery is handed to a queue or performed in the request.
Defaults to queue when @stone-js/queue is enabled, and to inline otherwise, saying so
once. Queueing is what this module is shaped around: deciding and recording is fast, reaching a
mail provider is not, and a request that waits for one is a request that times out on a
function-as-a-service platform.
OptionalnoticesThe notices this application declares, when it declares them in configuration rather than with
@Notice. Both are read, and both say the same thing.
OptionalqueueThe queue to dispatch on. Defaults to the application's default queue.
OptionalrecipientsHow to turn an id into a person.
The one thing this module cannot ship. Point it at whatever already knows, and the address is read at send time rather than copied into a message.
recipients: async (id) => await accounts.contactFor(id)
OptionaltemplatesTemplates, for an application that does not carry a translation catalogue.
When @stone-js/i18n is enabled, keys are looked up there instead, in the recipient's
locale. These are the fallback, and the override: a key found here is used as it stands.
Options for the
@Notificationsactivation.