Skip to main content
sendEmail sends plain text, Markdown, or HTML to one member or every member of the project’s organization. It can’t address anyone outside that organization; use Gmail, Outlook, Resend, or Brevo for other recipients.

Example

automations/notify-organization.automation.ts
Only organization members can open this form. Each submission sends the message to every current member and counts each recipient against the Platform email allowance.

Inputs

Every input accepts a compatible signal. Provide at least one of text, markdown, or html. sendEmail preserves supplied plain-text and HTML bodies. Markdown generates either missing alternative. Otherwise, HTML generates plain text, and plain text generates HTML. Attachments preserve each File’s name and media type. The complete email, including attachments after Base64 encoding, must be no larger than 40 MB. The scoped replyTo form resolves to the matching onMailhook address. Its scope is static, while plusPath can be a string or signal. The path appends an email plus-addressing suffix, which the mailhook event receives as plusPath. It must contain valid email local-part characters, and the complete local part before @ must fit the 64-byte email limit. Omit replyTo to omit the Reply-To header.

Thread replies

Use custom headers to reply to an onMailhook message in its existing thread. Set In-Reply-To to the received message’s messageId. Build References from its references, or its inReplyTo when references is empty, followed by its messageId.
Do not use the id returned by sendEmail as a threading target. It is Resend’s internal email resource ID, not the RFC 5322 Message-ID delivered with the email. Mailhook messageId, inReplyTo, and references contain the on-the-wire IDs needed to reply. Mailhook inReplyTo identifies the received message’s parent; it is not the received message’s own ID. to must be a current member’s address. Omit it to notify all current members. Platform email uses the organization’s monthly Platform email allowance. Each recipient counts as one send. sendEmail adds immutable Auto-Submitted: auto-generated and authenticated automation-origin headers. Auto-Submitted prevents automatic replies from compliant mail systems. Gmail triggers with the same origin don’t wake the sending automation, but other automations watching that mailbox still receive the event.

Output

sendEmail returns { id: string | null }. id is Resend’s internal email resource ID when available. It is not an RFC 5322 Message-ID and is not a valid In-Reply-To or References value.