MishkaCmsCore.Mail.Workers.DeliverWorker (Mishka CMS Core v0.0.1)

Copy Markdown View Source

Sends one queued email (see MishkaCmsCore.Mail), on the mail queue.

The job carries the delivery's id, its site, its idempotency key and the email sealed with the endpoint's key — a reset or sign-in email holds a token, and finished jobs stay in oban_jobs for a week. It carries no provider key: the provider reads its own when the job runs.

A failure the provider calls worth retrying (MishkaCmsCore.Mail.Provider.retry?/1) is retried with Oban's backoff, with the same idempotency key; anything else, and the last attempt, ends the delivery :failed. A site that lost its provider in the meantime ends it :not_configured. Once the provider has answered, the site's history older than mailer.history_days goes (MishkaCmsCore.Mail.prune/1).