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.
| Variable | Description |
|---|---|
| USESEND_API_KEY | API key generated in useSend |
| USESEND_URL | Base 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
| Option | Type | Description |
|---|---|---|
| apiKey | string | useSend API key |
| useSendUrl | string | Base URL of the useSend API |
| defaultFromAddress | string | Fallback sender email address |
| defaultFromName | string | Fallback sender display name |
These values apply to all email sent through Payload unless overridden by provider-side logic.
Optional
| Option | Type | Description |
|---|---|---|
| scheduledAt | string | ISO 8601 datetime for scheduled delivery |
| templateId | string | useSend template identifier |
| variables | object | Template 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