100% Automated AI Email Bot

Building an OpenAI Assistant, trained on your past emails and answers, combined with a Make workflow automation to reply instantly to incoming emails

Let’s build an AI email bot using Make.com and OpenAI's Assistants API. An email bot helps you automate responses to common or repetitive questions, freeing up your time.

We’ll walk through setting up filters in Gmail, creating an OpenAI Assistant, updating the Assistant’s knowledge base, and building out a workflow automation in Make.com.

Here’s the Youtube version of this post:

Are you interested in content creation, personal branding, or building a business?

This helps me tailor content to you. If you select "No", you will not receive all newsletters related to content, brand, or business.

Login or Subscribe to participate in polls.

Compile Training Data

Before building the bot, let’s compile training data.

This will teach the bot how it should respond to incoming emails.

The simplest approach is to use a Google Sheet or Excel file and create columns for “Question” and “Answer”. Insert examples of past questions and ideal answers.

For my use case, I also created another sheet containing links to my free courses, resources, and content because I want my bot to direct folks to them.

Set Up Gmail Filters and Labels

To make sure my email bot only responds to emails related to my newsletter, I setup Gmail filters and labels based on keywords in the email subject or body. If the incoming email contains keywords related to my newsletter, then it gets labeled “Newsletter”.

This will be used in our Make scenario, which will only run when a new email comes in with the label “Newsletter”.

Of course, modify this to suit your use case.

In my case, I don’t want my email bot to respond to ALL incoming emails, just the subset of emails related to my newsletter.

Here are the steps:

  • Open Gmail and navigate to settings

  • Access 'See all settings' and click on 'Labels'

  • Create new labels for categorizing emails (e.g. 'Newsletter')

  • Go to 'Filters' and set up filters for specific keywords related to email categories.

  • For my use case, I created filters to detect keywords like 'confirm' or 'subscription' in the subject.

Configure Make.com to Monitor Emails

Next, create a Make scenario that watches for incoming emails with a specific label.

This ensures Make only processes emails you want the bot to reply to, skipping the rest.

Here are the steps:

  • Access make.com and create a new scenario

  • Select Gmail as a trigger with 'Watch Emails'

  • Specify the folder as the label you created ('Newsletter')

  • Choose to process only unread emails

  • Optionally, mark the email as read after processing

Create OpenAI Assistant

Now, let’s create an OpenAI Assistant, which is a finetuned version of ChatGPT, trained with your custom data and knowledge (e.g. sample emails and replies).

You’ll learn how to configure the assistant's system instructions and knowledge base to get better accuracy. Using OpenAI allows our email bot to generate contextually appropriate responses based on data we provide.

First, create an OpenAI platform account if you don’t already have one:

  • Create an OpenAI platform account at platform.openai.com

  • Setup billing and phone number verification

  • Obtain an API key from 'API Keys' under the 'Organization' section

  • Copy the API key

  • Go back to Make.com and add a 2nd step: “OpenAI” > “Message an Assistant”

  • Connect your OpenAI account by pasting your API key

  • Go to the OpenAI Assistants Playground and create a new assistant.

Here’s how I setup my email bot assistant, including my prompt in System Instructions:

# WRITING STYLE

Here’s how you always write:

<writing_style>

- Your writing style is spartan and informative.
- Use clear, simple language.
- Employ short, impactful sentences.
- Incorporate bullet points for easy readability.
- Use frequent line breaks to separate ideas.
- Use active voice; avoid passive voice.
- Focus on practical, actionable insights.
- Use specific examples and personal experiences to illustrate points.
- Incorporate data or statistics to support claims when possible.
- Ask thought-provoking questions to encourage reader reflection.
- Use ""you"" and ""your"" to directly address the reader.
- Avoid metaphors and clichés.
- Avoid generalizations.
- Do not include common setup language in any sentence, including: in conclusion, in closing, etc.
- Do not output warnings or notes—just the output requested.
- Do not use hashtags.
- Do not use semicolons.
- Do not use emojis.
- Do not use asterisks.
- Do not use adjectives and adverbs.
- Do NOT use these words:
""""""can, may, just, that, very, really, literally, actually, certainly, probably, basically, could, maybe, delve, embark, enlightening, esteemed, shed light, craft, crafting, imagine, realm, game-changer, unlock, discover, skyrocket, abyss, you're not alone, in a world where, revolutionize, disruptive, utilize, utilizing, dive deep, tapestry, illuminate, unveil, pivotal, enrich, intricate, elucidate, hence, furthermore, realm, however, harness, exciting, groundbreaking, cutting-edge, remarkable, it. remains to be seen, glimpse into, navigating, landscape, stark, testament, in summary, in conclusion, moreover, boost, bustling, opened up, powerful, inquiries, ever-evolving""""""

# PLANNING

First, read the content of the email carefully and determine the appropriate category based on the details provided within the email. Here are the 2 categories:

1. Help with newsletter subscription
2. Question about AI

# OUTPUT

If the email is classified as category 1, your reply should be, "On my end, I see the confirmation email was sent to you. Please check your spam, junk, promotions, and updates folder. Then teach gmail by dragging the email over to "Primary". Let me know if that works!"

If the email is classified as category 2, always retrieve information first! Then, write a 2-sentence reply, directing the person to the most relevant links from LINKS.JSON file. ALWAYS type the full links. Use the sample answers from ANSWERS.JSON file as guidelines. NEVER include a question in your reply.

LINKS.JSON has links to educational AI content.
ANSWERS.JSON has sample replies to previous emails.

Upload Files to OpenAI Assistant

Next, let’s upload relevant files to our assistant.

Go back to the Google Sheets or Excel file where you compiled past emails and answers. You can export it as PDF and upload it to your assistant.

But for the best results, I recommend exporting your file in CSV format, then using a free tool to convert the CSV to JSON. In my experience, uploading structured data tends to result in better answers.

Once you have your files ready to go, upload them to your assistant by clicking "+ Files”.

Test that everything works as expected by typing sample emails (right side of screen) and seeing how your email bot assistant responds. The OpenAI playground allows you to test various email scenarios. I recommend updating the training data you uploaded, based on your testing results to further refine accuracy.

Complete Workflow Integration in Make

Finally, let’s integrate everything in our Make scenario.

Add a 3rd step > Gmail > Send an Email.

Optionally, you could Draft an Email instead.

Here’s how I configured the 3rd step:

For testing purposes, I set “Email address 1” as my own email address, so I could test the whole workflow before replying to anyone else.

Don’t forget to enable the Make scenario. You can click “Run Once” to test it out. Just make sure you have an unread email with the specific label, so that the Make scenario will be triggered.

Over time, regularly check email responses to verify your bot is working as expected and feel free to adjust your OpenAI Assistant’s settings, system instructions, or training data to optimize performance.

Closing

In under an hour, you can setup this 100% automated AI email bot to help you process emails, saving you time to focus on more strategic tasks. As you refine your bot's training data and settings, its responses will improve over time. Also, you can create different Gmail labels and Make scenarios to handle different types of emails, or you can use a Make router to handle complex situations within a single workflow.

The possibilities are endless 🙂 

Need More Help? đź‘‹ 

1/ If you want to learn how to grow on social media and make $20K/month through coaching, consulting, speaking, selling apps, or digital products… check out Blotato — Distribute 30+ pieces of content/week 🍄

2/ Free AI courses & playbooks here.

3/ 1:1 meeting?

I don’t do calls, coaching, consulting, partnerships, or collaborations. For Blotato users, I host Weekly Office Hours on content & strategy. You also get rewards if you refer this newsletter:

  • 10 people → 1000 viral hooks database

  • 40 people → AMA 3 questions over email

  • 100 people → 60-minute 1:1 work session w/ me

Here’s your referral link: https://www.sabrina.dev/subscribe?ref=PLACEHOLDER