Skip to main content
sendEmail sends custom content or a published Resend template. It supports complete recipient fields, attachments, headers, tags, topics, scheduling, and request idempotency.

Example

automations/send-resend-welcome.automation.ts

Inputs

to accepts one address or up to 50 addresses. Optional cc, bcc, and replyTo accept one or more addresses. For custom content, from, subject, and at least one of html or text are required. For a template, provide template: { id; variables? } and do not provide html or text; the published template may supply sender and subject. Optional fields include headers, scheduledAt (natural language or ISO 8601), topicId, and tags. Tag names and values allow letters, digits, _, and - and are limited to 256 characters. Template variable names have the same basic character set without dashes; values are strings up to 2,000 characters or numbers. idempotencyKey is retained by Resend for 24 hours and is limited to 256 characters. Attachments are either { content, filename, contentType?, contentId? } with base64 content or { path, filename?, contentType?, contentId? } with a public URL. Resend enforces its provider size limits.

Output

Returns { id: string }. Save the ID to retrieve delivery state, update a scheduled send, cancel it, or correlate webhook events.