Streamline Your Workflow with Gmail Automation

Master Efficiency: Gmail Automation Simplified

Streamline Your Workflow with Gmail Automation

Introduction

In this tutorial, we will walk through how to create an automated Gmail autoresponder bot using the intuitive automation platform Make. With this bot, you can automatically generate responses to incoming emails using the powerful GPT-3 AI model from OpenAI.

The bot works by connecting several modules together into a workflow:

  1. The Gmail module watches for new incoming emails and triggers the workflow when there are new messages.
  2. The email content is sent to the OpenAI module, which generates a response using GPT-3.
  3. The raw GPT-3 output is passed through a Markdown to HTML module to convert it into properly formatted HTML.
  4. Finally, the response email is constructed and sent back to the original sender via the Send Email module.

By chaining together these different building blocks, we can create a hands-off automated system for responding to emails without any ongoing human involvement. The GPT-3 AI will generate thoughtful, detailed responses based on the content of each incoming message.

This bot is great for handling common customer service emails, newsletters, and other scenarios where you want quick, personalized responses at scale. Read on for the step-by-step guide!

Step 1: Sign Up for Make

  • First, you’ll need to sign up for a Make account at Make.com. Make offers a free plan that will support our basic email bot workflow.
  • Once signed in, you’ll arrive at the Make dashboard. This is where you can create and manage your automations.

Step 2: Create a New Scenario

  • Make uses “scenarios” to house your workflows. Let’s create a new scenario for our email responder bot.
  • Click the “Create Scenario” button and give your scenario a name like “Email Autoresponder Bot”. You can leave the workflow trigger set to “Manual” for now.

Step 3: Add the Gmail Module

Streamline Your Workflow with Gmail Automation

  • With an empty scenario created, we can start adding modules to build out the workflow.
  • The first module we need is Gmail, since we want to watch for new incoming emails. To add a module, click the “+ Module” button on the canvas.
  • This will open the module library. Search for “Gmail” and you should see some options pop up. We want the “Check for new emails” module.
  • Click to add this module to the canvas.

Step 4: Authenticate with Gmail

  • After adding the Gmail module, a configuration panel will appear on the right side.
  • Here you need to connect your Gmail account by clicking “Authenticate your account”. Follow the steps to sign in to your Gmail account and grant access.
  • For our bot, we want to watch the inbox that will be receiving customer/client emails. Choose that inbox in the “From email address” dropdown.
  • You can leave the filters blank to check all emails in that inbox.

Step 5: Add the OpenAI Module

Now that we’re watching for new Gmail, we need to generate responses to those emails. This is where OpenAI comes in!

Streamline Your Workflow with Gmail Automation

  • Click “+ Module” again and search for “Open AI”. Choose the “Create completion” module.
  • Just like Gmail, you’ll need to authenticate with your OpenAI API key. You can get an API key for free by signing up at [openai.com](http://openai.com).
  • Paste your secret API key into the module configuration.

Step 6: Configure the OpenAI Prompt

  • With OpenAI connected, we now need to configure the prompt that will generate our email response.
  • The prompt is made up of two items the email context, and the response instructions.
  • Under “Message 1”, set the Role to System. This will tell GPT-3 that the first message is providing context.

In the text area, put something like:

“`
You are an Email assistant created by OpenAI to be helpful, harmless, and honest. Your job is to generate thoughtful, detailed responses to customer service emails.

Customer email:
“`

This gives GPT-3 background on its role.

  • Under “Message 2”, set the Role to User. This message will contain the actual email content.

We can reference the email subject and body that we’re watching for with:

{{ Gmail.subject }}

{{ Gmail.plain_text_body }}

Assistant response:

  • This inserts the email details as the prompt, and asks GPT-3 to generate the response.
  • You can tweak the number of tokens, temperature, etc. to optimize the responses.

Step 7: Convert Response to HTML with Markdown

So far we have the plain text response from GPT-3. But we want to send an HTML email for proper formatting.

Streamline Your Workflow with Gmail Automation

  • To convert to HTML, we’ll chain the Markdown to HTML module after OpenAI.
  • Add the Markdown to HTML module to the canvas, and connect it after OpenAI.

In the module settings, set the Input Type to Raw Text and the Input Text to:

{{ OpenAI.message }}

This inserts the GPT-3 response as the input to convert to HTML.

Step 8: Send the Email with Gmail

The last step is sending the response back to our customer using the Gmail Send Email module.

Send the Email with Gmail

  • Add this module and authenticate with the Gmail we want to send from.

In the module settings, set:

Recipient: `{{ Gmail.from_email }}` (the original sender)

Subject: `Re: {{ Gmail.subject }}`

Body: `{{ Markdown_to_HTML.html }}`

This constructs the full response email using details from the original message.

Step 9: Connect the Modules

We have all our modules, now we just need to connect them together!

Connect the modules in this order:

  • Gmail > OpenAI > Markdown to HTML > Gmail Send Email
  • This chains together the steps, passing the email → generating response → converting to HTML → sending email.

Step 10: Test and Refine the Bot

Our bot is ready! You can now test it by sending an email to your monitored inbox and watching it respond.

Send the Email with Gmail

Review the GPT-3 responses and further tweak the prompt and settings if needed to get great responses tailored to your use case.

You can activate the scenario to have it run continuously. Make also supports scheduling it at specific times if you don’t need 24/7 uptime.

And that’s it! With just a few modules and connections, you now have a hands-off Gmail autoresponder bot powered by AI. You can further build on this workflow to support more complex email handling logic.

The flexibility of Make and GPT-3 makes it simple to create automated workflows like this that would normally require complex programming. Intelligent automation is the future
give it a try with this email bot starter workflow!

Detailed Step-by-Step Instructions

Now let’s go through each step outlined above in more detail. We’ll look at every click needed to set up this automation from start to finish.

Step 1: Sign Up for Make

  1. Go to Make.com
  2. Click “Get Started” in the top right corner
  3. Enter your email address and choose a password
  4. Click “Create Account”
  5.  Check your email to confirm your account
  6. In the email, click the account confirmation link
  7. You will be redirected back to make.com, now logged into your new account!

Step 2: Create a New Scenario

  1. After logging in, you will be on the Make dashboard
  2. Click the large “+” button in the top right corner
  3. Select “New Scenario” from the dropdown menu that appears
  4. In the popup, name your scenario “Email Autoresponder Bot”
  5. Leave the trigger set to “Manual”
  6. Click “Create Scenario”

Step 3: Add the Gmail Module

  1. In your new scenario, click the “+ Module” button
  2. This opens the module library
  3. search for “Gmail”
  4. Hover over the “Check for new emails” module
  5. Click the “+” icon to add it
  6. The module will be added to the canvas

Step 4: Authenticate with Gmail

  1. In the right panel, select the Gmail module
  2. Under Authentication, click “Authenticate your account”
  3. This will open a popup
  4. click the Google account you want to connect
  5. Sign in with your Google account credentials if prompted
  6. Accept the permissions request to allow Make access
  7. You will be redirected back to Make
  8. Gmail is now connected!
  9. Under From Email Address, select the inbox you want to monitor

Step 5: Add the OpenAI Module

  • Click the “+ Module” button again
  • Search for “OpenAI”
  • Hover over “Create completion” and click the “+” to add
  • The OpenAI module will be added to the canvas

Step 6: Configure the OpenAI Prompt

  1. Select the OpenAI module in the right panel
  2. Under Authentication, paste in your OpenAI API key
  3. Leave the model as the default GPT-3.5 Turbo
  4. Under Message 1, change Role to System
  5. Add context about the AI assistant as shown earlier
  6. Under Message 2, change Role to User
  7. Add the email variable prompts as shown earlier
  8. Tweak temperature, tokens, etc. if desired

Step 7: Convert Response to HTML

  1. Click “+ Module” and search “Markdown”
  2. Hover over “Markdown to HTML” and click the “+” to add
  3. Connect this module after the OpenAI module
  4. Set the Input Type to Raw Text
  5. Set the Input Text to `{{ OpenAI.message }}`

Step 8: Send the Email

  1. Add the Gmail “Send an email” module
  2. Authenticate with the desired sending Gmail
  3. Set Recipient to `{{ Gmail.from_email }}`
  4. Set Subject to `Re: {{ Gmail.subject }}`
  5. Set Body to `{{ Markdown_to_HTML.html }}`

Step 9: Connect the Modules

  1. Connect Gmail → OpenAI → Markdown to HTML → Send Email
  2. Click and drag the dot on the right of one module
  3. Connect it to the dot on the left of the next module
  4. Do this to link all modules together in sequence

Step 10: Test and Refine

  1. Send a test email to your monitored Gmail inbox
  2. See if you get an automated response
  3. Check the response quality and tweak the OpenAI prompts if needed
  4. Activate your scenario from the top right to run continuously
  5. Or schedule it if you only want responses during certain hours

And that covers it! By following these steps, you now have a fully automated AI email responder bot set up with Make. Let me know if any part needs further explanation or if you have any other questions!