• Home

  • Automation with Zapier

  • Zapier tutorials

Zapier tutorials

5 min read

How to use OpenAI's ChatGPT to write business emails automatically

By Elena Alston · October 1, 2024
Screenshot of ChatGPT logo on a yellow background

Whether you work in customer service, sales, or freelance marketing, you probably spend a fair share of your time writing business emails.

From follow-ups to support tickets and more, it can be difficult to draft friendly yet professional emails on the fly (not to mention at scale). You might know what you want to say but still struggle to put your ideas into words. Or perhaps you have limited resources and not enough hands on deck to help you write those follow-ups in bulk.

You may have used ChatGPT  to help write email responses before, but it can be time-consuming to copy the emails your customers send, paste them into ChatGPT, and then transfer the AI-generated response back into Gmail.

 That's where our ChatGPT integration can save the day. With one simple Zap, whenever you receive a new customer email, OpenAI's ChatGPT will write a carefully curated response and automatically save it as a Gmail draft.

New to Zapier? It's workflow automation software that lets you focus on what matters. Combine user interfaces, data tables, and logic with thousands of apps to build and automate anything you can imagine. Sign up for free.

Write emails with Zapier's ChatGPT integration

Zapier lets you create automated workflows called Zaps, which send your information from one app to another. You can create your own Zap from scratch without any coding knowledge, but we also offer quick templates to get you started. 

If you'd like to start with a template, click on the Zap template below, and you'll be taken to the Zapier editor. You'll need to create a Zapier account if you don't already have one. Then, follow the directions below to set up your Zap.

Create email copy with ChatGPT from new Gmail emails and save as drafts in Gmail

Create email copy with ChatGPT from new Gmail emails and save as drafts in Gmail
  • Gmail logo
  • ChatGPT logo
  • Gmail logo
Gmail + ChatGPT

This workflow requires a multi-step Zap, which is available on a paid Zapier plan or during a free trial. Learn more about multi-step Zaps.

Before you begin

If you haven't set up your Zapier connection to OpenAI, you'll need to do that now. To start, go to platform.openai.com to log into your account. Expand the left sidebar and click API keys:

Screenshot of API keys

Next, click + Create new secret key to generate a new API key. You'll need this key to connect your OpenAI account within Zapier. Copy this key and store it somewhere safe.

Screenshot of secret key in openai

Want to build GPT-powered apps for your clients or coworkers? Zapier's new Interfaces product makes it easy to create dynamic web pages that trigger automated workflows.

Set up your Gmail trigger

First, set up your trigger—the event that starts your Zap. Select Gmail for your trigger app and New Email for your trigger event.

Screenshot of trigger app and event

If you haven't already, you'll be asked to connect your Gmail account. Click on Select an account… and either select an account from the dropdown menu (if you've connected Gmail to Zapier before) or click + Connect a new account.

Screenshot of account email address

Click Continue. Next, select which label or mailbox you want to collect emails from. Click the dropdown menu to see the labels and mailboxes available in your connected Gmail account. In this instance, we've set up a separate Gmail label called Customer emails so that whenever we receive an email from a customer, we can move it to this label and set off the Zap. 

Now, select the Customer emails label. (If no label or mailbox is selected, the Zap will trigger on all emails, even your drafts.)

Screenshot of email label or mailbox

Click Continue. 

Now, you need to test your trigger. Zapier will find a recently received email with the label you selected. This will be used to set up the rest of your Zap. 

If you don't have any emails, send yourself a sample email and label it appropriately, then test your Zap.

Click Test trigger. It will pull in the sample email with the right label. Once you see that your trigger is working correctly, click Continue with selected record.

Screenshot of test data

Set up your ChatGPT action

Now let's set up the action—the event your Zap will perform once it's triggered. Select ChatGPT as your action app and Write an Email as your action event.

Screenshot of ChatGPT action set up

Then, if you haven't already, you'll be asked to connect your OpenAI account to Zapier. Click on Select and either select an account from the dropdown menu (if you've connected OpenAI to Zapier before) or click + Connect a new account, then click Continue. You'll be asked to insert your OpenAI API key, which you copied earlier. Once you've done that, your account will be connected.

Screenshot of account set up

Then, you need to tell your Zap how to generate your email content. 

You can pull in data from your Gmail emails by clicking inside any empty field where you want the data to go and selecting an option from the Insert Data dropdown menu. This includes the recipient name, recipient email, and the name of the person.

Screenshot of zap setup

Once you've finished mapping fields from your Gmail step, your step will look something like this:

Screenshot of Gmail fields

The most important factor will be your prompt. In the Email Prompt field, provide clear instructions for what you want ChatGPT to write. In this instance, the prompt is: Generate a business email response in UK English that is friendly, but still appropriate for the workplace. 

For the email topic, we'll pull in the email body from the sample email the Zap selected. You can also set the tone of the email (neutral, formal, or casual) and select whether the email should be plain text or HTML.

Screenshot of email prompt

Finally, you can select the OpenAI model you want to use (which may depend on your account access). It's set by default to GPT-4o mini, which we recommend as your go-to model, as it's designed to cover any fast, lightweight tasks you need when automating. 

You can also adjust the temperature of the writing you're after (creativity levels) and the maximum tokens.

Screenshot of chatgpt model 4o mini

Once you've finished customizing these fields, click Continue

Now it's time to test your action. When you click Test step, Zapier will pull in the generated copy from ChatGPT according to how you customized the fields in your Zap.

Screenshot of AI generated email

Once you see that your action is working correctly, click the +icon at the bottom of your step.

Screenshot of plus icon

Set up your Gmail action

Next, it's time to set up one more action step. Select Gmail for your action app and Create Draft for your action event.

Screenshot of Gmail action event

Once again, you'll be asked to connect your Gmail account. Connect the Gmail account where you want your draft emails to be generated. In this case, we're using the same Gmail account where we receive the customer emails. 

Click Continue

Now it's time to set up the way your draft emails will look. Make sure you pull in the customer's email address (the original sender) by clicking in the To field and selecting the From Email address from the dropdown data. This is so that you can send your draft email straight back to the customer once you've reviewed your AI-generated email. 

You can also choose who you want to be cc'd or bcc'd onto these emails. 

Screenshot of from email address in Gmail

In the subject line, you can pull in data from the original email your customer sent you and customize the sender's name in the From Name field. Again, you can also choose whether your email response will be plain text or HTML. (Make sure it matches the email type you selected in your previous ChatGPT step.)

Screenshot of subject line

Once you're done, you can now pull in your ChatGPT results by clicking in the Body field and selecting Body from the data dropdown.

Screenshot of body mapped fields

In addition, you can also include a default signature with the email, add these drafts to a label or mailbox, and include attachments, if necessary. 

Once you've finished customizing these fields, click Continue

Now it's time to test your action. Click Test step. Zapier will create a draft email for you.

Screenshot of Gmail test

Once you've reviewed the draft email your Zap created, your Zap is now ready to use. If something looks off, go back and tweak things until you get it just right.

The Zap will now create your business emails and save them to your drafts in a matter of seconds. Here's what ours looks like:

Screenshot of email copy generated by AI

Use ChatGPT for email writing

Now, every time a customer or lead sends you an email, this Zap will create a draft response for you and add it to your Gmail drafts folder. All you have to do is review your draft, tweak any specifics, and send it straight back to your client. 

You won't have to worry about wording or not coming across as professional, as ChatGPT will sort it out for you, allowing for faster response time.

Create email copy with ChatGPT from new Gmail emails and save as drafts in Gmail

Create email copy with ChatGPT from new Gmail emails and save as drafts in Gmail
  • Gmail logo
  • ChatGPT logo
  • Gmail logo
Gmail + ChatGPT

Related reading:

  • How to write sales emails with OpenAI and Zapier

  • How to use OpenAI's GPT-3 to spark content ideas

  • How to create meeting summaries with OpenAI's GPT-3

  • How to build a ChatGPT Slack bot with Zapier

  • 6 ChatGPT prompts that will generate great sales emails

  • The best AI email assistants

This article was originally published in January 2023. It was most recently updated in October 2024.

Get productivity tips delivered straight to your inbox

We’ll email you 1-3 times per week—and never share your information.

tags
mentioned apps

Related articles

Improve your productivity automatically. Use Zapier to get your apps working together.

Sign up
See how Zapier works
A Zap with the trigger 'When I get a new lead from Facebook,' and the action 'Notify my team in Slack'