> ## Documentation Index
> Fetch the complete documentation index at: https://docs.automate.ax/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# Send email

> Send or schedule a rich transactional email through Resend.

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

## Example

```ts automations/send-resend-welcome.automation.ts theme={null}
import { automation, onHttpRequest } from "automate.ax"
import { sendEmail } from "automate.ax/resend"

export default automation("Send Resend welcome", () => {
  onHttpRequest({ scope: "automation" })
  sendEmail({
    from: "Acme <hello@example.com>",
    to: "person@example.com",
    subject: "Welcome",
    html: "<h1>Welcome</h1>",
    text: "Welcome",
    tags: [{ name: "kind", value: "welcome" }],
    idempotencyKey: "welcome-person-123",
  })
})
```

## 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.
