Skip to main content
The top-level mail facade exposes:
  • mail.inbox(options?)
mail.inbox(...) is a thin facade over the currently configured emails client. If no client has been configured, it throws a setup error that points callers to configureEmailsClient(...). Example:

Inbox Handle

The returned inbox handle exposes:
  • emailAddress
  • sendMessage(...)
  • waitForMessage(...)
  • waitForMessages(...)
The current exported wait type is shared by both wait methods. The sections below describe which fields each method actually uses. Pass {} when you want default wait behavior. Example:

Current GetInboxOptions

Current validation and behavior:
  • new: true derives a unique address based on the current default
  • delimiter customizes the separator used for derived addresses
  • address must come from the allowed workspace address set
  • omitting address triggers a lookup of the workspace default address
If teamId is missing from the runtime client configuration, inbox creation fails. Examples:

sendMessage(...)

Current input shape:
Behavior:
  • to is always an array of strings
  • at least one of html or text is required
  • attachments are base64-encoded before the request is sent to the email service
Return shape:
Example:

waitForMessage(...)

Current method options:
For waitForMessage(...), the implementation uses:
  • after when it is provided
  • otherwise the time when mail.inbox(...) was called
  • timeout when it is provided
It returns one ParsedEmail and throws if no message arrives in time. Example:

waitForMessages(...)

Current method options:
Behavior:
  • it uses after when provided, otherwise the time when mail.inbox(...) was called
  • it waits for delay first
  • it polls until at least minCount messages are found, or until timeout
  • it returns the matching parsed emails
Example:

Parsed Email Shape

The parsed email shape is:
urls is derived by parsing links from the HTML body. Example:
Last modified on June 1, 2026