Pass hooks to any provider to run awaitable callbacks around every send. before.send can
observe, rewrite, or cancel a message; the rest are best-effort observers — an error they
throw is swallowed, so logging and telemetry can never break a send. In a bulk send(array), hooks run once per message.
Setting the same hooks on every instance? Define them once in
postboi.settings.tsand they apply everywhere — including the zero-configsend().
The hooks
Cancelling a send
Cancel a send from before.send by throwing SkipSendError (e.g. a suppressed or
unsubscribed recipient). It’s a PostboiError with code: "skipped", and it does not trigger on.error: