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

Capture plugin

Record email events in tests.

Use the capture plugin in tests when you need to assert what the email client tried to do.

What gets captured

Event Meaning
beforeSend The message entered the send pipeline.
afterSend A provider returned a normalized response.
retry Email SDK scheduled another attempt.
error A provider attempt failed.

Captured events include the message and whichever provider, attempt, metadata, response, or error details exist at that point in the lifecycle.

Clear events

Bring your own store

Multiple capture stores

Use a custom id for plugin identity and a custom clientKey for the typed client property.

Capture vs memory provider

capturePlugin() records lifecycle events. It does not stop real provider calls.

memoryProvider() is the adapter you use when a test should avoid external email. In most tests, use both: memory avoids the network, capture proves the SDK pipeline behaved correctly.

Last updated on