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

# Create email draft

> Create an unsent Apollo email draft.

`apollo.createEmailDraft` creates an unsent email for a saved contact or as a reply to an existing Apollo message.

```ts automations/create-apollo-email-draft.automation.ts theme={null}
import { automation, onDashboardRun } from "automate.ax"
import { apollo } from "automate.ax/apollo"

export default automation("Draft an email", () => {
  onDashboardRun({ title: "Draft an email" })
  apollo.createEmailDraft({
    contact: "ada@example.com",
    subject: "Following up",
    bodyHtml: "<p>Would Tuesday work?</p>",
  })
})
```

Provide `contact` or `inResponseToMessageId`. Optional fields include recipients, template, attachments, subject, body, task, and tracking. Returns the draft as an `ApolloEmail`.
