Skip to content
You're viewing documentation for v0.2.1. It may be out of date.Go to latest
Email SDK
Esc
↑↓navigate↵open⌘Jpreview
On this page

Hooks

Observe sends without changing adapter code.

Hooks are for logs, metrics, tracing, and retry visibility.

Hook events

Each hook receives:

Field Notes
provider Routing name used for this attempt.
message The original EmailMessage.
attempt Current attempt number.
metadata Optional metadata passed to send.

afterSend also receives response. onRetry receives nextAttempt and delayMs. onError receives error.

Keep logs safe

Do not log API keys, SMTP passwords, raw tokens, full message bodies, or unnecessary recipient data. For most production logs, routing name, status, subject category, template name, and message ID are enough.

Last updated on