Skip to main content
LocalTradeBook

Development

How email is queued and sent

One seam for every email: queue, toggle, send, log.

Every email the directory sends goes through one function. It writes a row, checks that the email's type is switched on, sends it with your mailer (or the platform's) and records the outcome.

  • Types. Each kind of email has a key (for example claim.verify) and an on/off switch per directory.
  • Secrets. Links that grant access are held separately, encrypted, and erased once sent; the send log never shows them.
  • Retries. A failed send is retried after 1 minute, 5 minutes, 25 minutes and about two hours, then marked failed.
  • Offline directories. Mail for a suspended or archived directory is skipped, never sent later.
  • Status. With Resend, delivered and bounced outcomes come back by webhook or by polling.
How email is queued and sent | LocalTradeBook