Cover image for: How to Automate Email With AI Tools (Step by Step)

How to Automate Email With AI Tools (Step by Step)

How to Automate Email With AI Tools (Step by Step)

Affiliate links ↓

Updated · May 1, 2026

You’re looking at 60 unread emails. Twenty of them need replies. Fifteen of those replies follow the same three patterns: a pricing question, a scheduling request, a “where’s my order” message. That’s the gap AI email automation fills — and you don’t need a developer or a custom integration to build it.

This guide walks you through setting up a workflow that reads new Gmail messages, generates a draft reply using GPT-4o, and drops it in your Drafts folder for review. The whole setup takes under an hour. Here’s what you need before starting:

  • A Gmail account (Outlook works too — see the FAQ)
  • A Zapier account on the Starter plan (~$20/month) — the free tier only supports single-step Zaps, which isn’t enough for this
  • An OpenAI account with API access (pay-as-you-go; for a typical inbox this costs pennies per month)
  • Optional: a Gmail label called “ai-draft” that you’ll use to control which emails get processed

If you’d rather avoid Zapier’s pricing, Make (formerly Integromat) covers 1,000 operations/month on its free tier and uses the same logic — you’d just build a Scenario instead of a Zap. The steps below focus on Zapier since it’s faster for first-time setups.

1. Create a new Zap and connect your Gmail account

Log into Zapier and click + Create in the left sidebar, then select Zaps. Name it something you’ll recognize later — “AI Email Drafter” works fine.

Click the Trigger block and search for Gmail. Select it, then choose New Email Matching Search as the trigger event. This is more useful than plain “New Email” because it lets you filter before anything runs.

Click Sign in to Gmail and complete the OAuth flow. Zapier requests read-only access initially, but you’ll need to grant send/draft permissions when you add the Gmail action later — accept both prompts.

2. Define which emails trigger the workflow

In the Search String field, enter your filter. This is standard Gmail search syntax. Three options that work well:

  • label:ai-draft — only runs on emails you’ve manually labeled in Gmail (safest for first-time setups)
  • from:@yourclient.com — fires on every email from a specific domain
  • subject:inquiry OR subject:quote is:unread — keyword-based, fires on matching unread mail

Start with the label approach. It means you control exactly which emails get an AI draft by adding the “ai-draft” label in Gmail — nothing runs automatically on your whole inbox.

Click Test trigger. Zapier pulls a recent matching email to use in the next steps. If nothing shows up, send yourself a test email and manually apply the “ai-draft” label, then test again.

3. Write the AI prompt that generates the reply

Click the + icon below the trigger block to add an action. Search for OpenAI (GPT-4 & DALL-E) and select Send Prompt.

Connect your account by pasting your OpenAI API key (find it at platform.openai.com under API keys → Create new secret key). Set the Model to gpt-4o-mini — it’s fast, cheap at scale, and handles email-length tasks reliably. Don’t use a heavier model here; you won’t see meaningful quality gains for short replies.

In the Prompt field, write your instruction. Be specific — vague prompts produce generic output. This version works well for customer-facing inboxes:

You are a professional assistant drafting email replies. Write a concise, direct reply to the email below in under 150 words. Skip filler openers like “I hope this email finds you well.” Do not invent information you don’t have — if you’re unsure of a detail, leave a [PLACEHOLDER] in brackets. Sign off as [Your Name].Subject: [map the Subject field from the trigger step] Body: [map the Body Plain field from the trigger step]

To insert the dynamic Gmail fields, click the + icon inside the prompt box and select the fields from your trigger step. Set Max Tokens to 400 — enough for a 150-word reply, and it keeps API costs predictable.

Click Test action. Zapier sends the test email to OpenAI and shows you the generated reply. Read it carefully — you’re evaluating whether the prompt is working, not approving this specific output for sending.

4. Route the output back to Gmail as a draft

Add another action step and search for Gmail again. Choose Create Draft — not “Send Email.” You want a human review before anything goes out, especially while you’re dialing in your prompt.

Map the fields:

  • To: select From Email from your Gmail trigger step
  • Subject: type Re: then map the Subject field from the trigger
  • Body: map the Response field from the OpenAI step
  • Thread ID: map Thread ID from the trigger so the draft appears inside the original conversation, not as a new thread

Click Test action, then open Gmail and navigate to Drafts. The reply should be sitting there, inside the correct email thread. If it is, the hard part is done.

5. Add filters so it doesn’t run on everything

Click the + between your Gmail trigger and the OpenAI step to insert a Filter. Add these two conditions under “Only continue if…”:

  • Body Plain does not contain unsubscribe
  • From Email does not contain noreply

This catches newsletters and automated notifications that slip past your label filter. Filters are free in Zapier and don’t consume tasks — add as many conditions as you need. If you’re using a domain-based trigger instead of labels, also filter out emails where From Email matches your own domain (so you’re not drafting replies to yourself).

6. Test on a real email and activate

Click Publish in the top right. The Zap is now live. Send yourself a test email from an external account, apply the “ai-draft” label, and wait up to 90 seconds. Zapier checks for new emails on a polling interval — you can also click Run in the Zap history to trigger it immediately.

Open the draft and read it honestly. The first few outputs will be 70% of the way there. Common things to fix in your prompt: the sign-off name, the tone (more formal or more casual), whether the AI is filling in guesses where it should leave placeholders instead.

After three or four real-world tests, the prompt usually stabilizes. Leave the Zap running and check the task history every few days to confirm it’s firing — Zapier sends an email alert if a Zap errors out more than a few times in a row.

When things go wrong

Gmail authentication expires after a few days. Google revokes OAuth tokens during inactive periods. Go to the Gmail step in your Zap and click Reconnect account. You may need to re-grant permissions.

The OpenAI step returns a 401 or 429 error. A 401 means your API key is invalid or expired — regenerate it at platform.openai.com. A 429 means you’ve hit OpenAI’s rate limit; this is rare for email volumes but can happen if you have multiple Zaps using the same key. Add a 5-second delay step before the OpenAI action to spread out requests.

Drafts appear as new emails, not in the original thread. This means the Thread ID field isn’t mapped correctly in the Gmail Create Draft action. Open that step, check the Thread field, and confirm it’s pulling from the trigger — not hardcoded or blank.

What to try next

Once the basic draft workflow is stable, the most useful extension is classification. Add a second OpenAI step before the draft step — ask it to categorize the email as “sales inquiry,” “support request,” or “other” based on the subject and body. Then use Zapier’s Paths feature to route each category to a different prompt. A billing question gets a different reply template than a demo request.

For longer emails — multi-paragraph threads, detailed client briefs — consider switching to the Claude API instead of OpenAI. Claude’s context handling on long inputs is stronger, and the API works through Zapier’s HTTP action with a POST request to Anthropic’s endpoint. It’s a slightly more manual setup but worth it if your inbox runs long.

Frequently asked questions

Is it safe to send email content through OpenAI’s API?

For most business email, yes. Unlike ChatGPT, OpenAI’s API doesn’t use your data for model training by default under their standard API terms. That said, don’t run this on emails containing passwords, legal communications marked confidential, or personal financial data. Review OpenAI’s API data usage policy before processing sensitive material.

How much does this cost per month to run?

Zapier Starter runs around $20/month. OpenAI API costs at gpt-4o-mini rates are genuinely negligible for email — processing 200 emails/month costs well under $0.10 at current pricing. Your main cost is the Zapier subscription.

Does this work with Outlook instead of Gmail?

Yes. Zapier’s Microsoft Outlook integration uses the same trigger logic — swap the Gmail steps for Outlook in steps 1 and 4, and use Outlook categories or folder filters instead of Gmail labels. The OpenAI step stays identical.

Can I use this to send emails automatically, not just save drafts?

Technically yes — swap the “Create Draft” action for “Send Email” in step 4. We’d recommend against it until you’ve run the workflow for at least two weeks and trust the output quality. An automated send to a client with a hallucinated detail does more damage than the time saved.

Bottom line
Zapier

If you want to automate email drafting without writing a line of code, Zapier is the most reliable way to connect your inbox to an AI model and get something working in an afternoon.

Try Zapier

Related reads

This article contains affiliate links. If you subscribe through one, we may earn a commission at no extra cost to you. It never changes what we recommend — we only link to tools we actually use. Full disclosure.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *