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

# On Resend email failed

> Start an automation when Resend fails to send an email.

`onResendEmailFailed` emits `email.failed` when Resend cannot send a message.
This differs from a recipient-server bounce that happens during delivery.

```ts automations/handle-resend-failure.automation.ts theme={null}
import { automation } from "automate.ax"
import { onResendEmailFailed } from "automate.ax/resend"

export default automation("Handle Resend failures", () => {
  const failed = onResendEmailFailed()
  failed.transform(({ createdAt, data }) => ({
    createdAt,
    emailId: data.email_id,
    reason: data.failed,
  }))
})
```

Optional static `account` selects the binding. Returns
`{ type: "email.failed"; createdAt: string; data: Record<string, JsonValue> }`.
Failure details remain in provider-native `data` and may vary by failure reason.
