Configuration

Configure PayloadCMS useSend Email Adapter with environment variables and adapter options for templates, scheduling, and REST-based delivery.

PayloadCMS useSend Email Adapter reads configuration from environment variables at runtime. These values are required for authentication and API routing.

VariableDescription
USESEND_API_KEYAPI key generated in useSend
USESEND_URLBase URL of the useSend REST API (cloud or self-hosted)

Values must be available to the Payload process and must not be committed to source control.

Separate API keys are recommended for development, staging, and production environments.


Adapter

Configuration options are passed to sendAdapter when registering the adapter in Payload.

Required

OptionTypeDescription
apiKeystringuseSend API key
useSendUrlstringBase URL of the useSend API
defaultFromAddressstringFallback sender email address
defaultFromNamestringFallback sender display name

These values apply to all email sent through Payload unless overridden by provider-side logic.

Optional

OptionTypeDescription
scheduledAtstringISO 8601 datetime for scheduled delivery
templateIdstringuseSend template identifier
variablesobjectTemplate variables passed to useSend

Optional fields are evaluated per email send and mapped directly into the useSend API payload.


Templates

When a templateId is provided, useSend renders the email using its templating engine. Variables supplied through variables are injected at render time.

Template creation, editing, and previewing are managed in useSend. Payload does not process template content.


Scheduling

When scheduledAt is set, the message is queued for future delivery by useSend. Scheduling is handled externally and does not require background jobs or task queues in Payload.

The timestamp must be provided in valid ISO 8601 format.


Once configured, calls to payload.sendEmail() continue to operate as normal within PayloadCMS. The adapter translates Payload’s email payload into useSend REST API requests.

Delivery, analytics, suppression handling, and retries are managed by useSend.

Last updated on 2/3/2026