Gmail

Getting Started With Gmail

Prerequisites

  • A Google account

In order to use Gmail with Integromat, it is necessary to have a Google account. If you do not have one, you can create a Google account at accounts.google.com.

Connecting Gmail to Integromat

To connect your Gmail account to Integromat as a Google Workspace user (formerly G Suite), follow the general instructions for Connecting to services.

If you are a @gmail.com or @googlemail.com user, you'll need to create an OAuth client on the Google Cloud Platform in order to obtain the Client ID and Client Secret.
For step-by-step instructions on how to create the OAuth client (and obtain the Client ID and Client Secret), please refer to the Connecting Integromat To Google Services Using a Custom OAuth Client documentation, or watch the video tutorial below.

To find out whether you are a G Suite user or @gmail user, please see the Google API restrictions (Do I have a G Suite account? section) article.


Did You Know?

You can find more than 40 predefined Gmail sample templates at www.integromat.com/en/templates/google-email.

Triggers

Watch Emails

ConnectionEstablish a connection to your Google account.
FolderSelect the email folder you want to watch.
Filter typeSelect the Simple filter option to filter emails by selected Criteria, or select the Gmail filter option to filter emails by entered Query.
QueryUse Gmail search syntax. E.g., to search for messages in the Social category that include an attachment, use category:social has:attachment. For more information, visit the Search operators you can use with Gmail page.
Mark email message(s) as read when fetchedSelect whether or not you want to mark retrieved emails as read.
Maximum number of resultsSet the maximum number of results that Integromat will work
with during one cycle.

Actions

Send an Email

ConnectionEstablish a connection to your Google account.
ToEnter the email address of the recipient(s) using the Add recipient button.
SubjectEnter the email subject.
ContentEnter the email content (message body). HTML tags are allowed.
AttachmentsAdd an attachment using the Add an attachment button. You can map a file from the previous modules. Set Content-ID (e.g., ii_jrc3r9mw1) if you want to attach inline images (embedded into content). You can put anything here, for example, "ii_jrc3r9mw1." This allows you to create an ID for the attachment, which you can then use in HTML like this:  
<img src="cid:ii_jrc3r9mw1">
More information about working with files.
Copy recipientsAdd the copy recipient(s). (CC:)
Blind copy recipients Add the blind copy recipient(s). (BCC:)

Create a Draft

ConnectionEstablish a connection to your Google account.
FolderSelect the Gmail folder you want to create a draft in.
ToEnter the email address of the recipient(s) using the Add recipient button.
SubjectEnter the email subject.
ContentEnter the email content (message body). HTML tags are allowed.
AttachmentsAdd an attachment using the Add an attachment button. You can map a file from the previous modules. More information about working with files.
Copy recipientsAdd the copy recipient(s). (CC:)
Blind copy recipients Add the blind copy recipient(s). (BCC:)

Mark an Email as Read

ConnectionEstablish a connection to your Google account.
FolderSelect the Gmail folder that contains the email.
Email ID (UID)Enter or map the Email ID.

2019-01-25_15_02_29-Window.png

Mark an Email as Unread

ConnectionEstablish a connection to your Google account.
FolderSelect the Gmail folder that contains the email.
Email ID (UID)Enter or map the Email ID of the email you want to mark as unread.

Move an Email

ConnectionEstablish a connection to your Google account.
FolderSelect the Gmail source folder that contains the email you want to move.
Destination folderSelect the Gmail target folder you want to move the email to.
Email ID (UID)Enter or map the Email ID of the email you want to move.

Copy an Email

ConnectionEstablish a connection to your Google account.
FolderSelect the Gmail source folder that contains the email you want to copy.
Destination folderSelect the Gmail target folder you want to copy the email to.
Email ID (UID)Enter or map the Email ID of the email you want to move.

Delete an Email

ConnectionEstablish a connection to your Google account.
Gmail Message IDEnter or map the Email ID of the email you want to delete.
Permanently
Permanently removes the message instead of moving it to the trash folder.

Modify Email Labels

ConnectionEstablish a connection to your Google account.
Gmail Message IDEnter or map the Email ID of the email you want to delete.
Labels to add
Select the label you want to add to the selected email message.
Labels to removeSelect the label you want to remove from the selected email message.
Label to add and Label to remove fields load only user-created labels.

2019-01-25_16_16_57-Window.png

Iterators

Iterate Attachments

More information on Iterators can be found on the Iterator help page.

Source moduleSelect the module you want to iterate attachments from. You can further process attachments using Dropbox>Upload a file, for example.

2019-01-25_17_09_02-Window.png

 

Tips & Tricks

To insert your default signature and company logo into Gmail's Send an email module:

1. First, you will need to use the Watch emails module to retrieve an email that contains your signature and logo. Then, copy the HTML content from the output bundle as shown below: 

mceclip1.png

 

2. Then, in the body field of the Send an email module, copy and paste the HTML content, or edit until you are left with a similar HTML code: 

<div dir="ltr">
<div>
<div>
<div class="gmail_signature" dir="ltr" data-smartmail="gmail_signature">
<div dir="ltr">{{5.text}}</div>
<div dir="ltr">&nbsp;</div>
<div dir="ltr">Integromat.
<div>&nbsp;</div>
<div><img src="https://docs.google.com/uc?export=download&amp;id=1u7XHeheTZrg5T7f54lRlOX2COwtZYiwU&amp;revid=0B4M0OPcY34MDeko1L0pCYXNlc1RXN0szUFJMNjhMRmcyNXZrPQ" /></div>
</div>
</div>
</div>
</div>
</div>

 

3. After you have adjusted the code, proceed to map the text content in the body field from the relevant elements in the appropriate HTML field. 

 

mceclip2.png

 

Troubleshooting

Failed to verify connection 'My Google Restricted connection'. Status Code Error: 400

Your connection has expired and is no longer valid. You need to reauthorize the connection.

This error affects non-Google Workspace accounts. For more details please refer to the Google OAuth documentation.

Solution

Reauthorize your Google connection.

1. Log in to Integromat.

2. Navigate to Connections.

2021-03-15_11_13_15-Window.png

3. Find your Google connection and click Reauthorize button.

2021-03-15_11_18_02-Window.png

To prevent the expiration of your Google connection, we suggest you to reauthorize the connection every week.

Popular use cases from our blog

automated-data-collection-crm-illustration

How to Automate Data Collection - Part 5: CRM Systems

automated-data-collection-chatbot-marketing-illustration

How to Automate Data Collection - Part 4: Chatbot Marketing

automated-data-collection-paid-ads-illustration

How to Automate Data Collection - Part 3: Paid Ads

automated-data-collection-email-illustration

How to Automate Data Collection - Part 2: Email Marketing Segmentation

personalized-customer-experience-illustration-integromat

5 Automated Solutions to Personalize Customer Experience

data-collection-automation-forms-pt-1

How to Automate Data Collection - Part 1: Online Forms

Didn’t find what you were looking for?

Expert

Find an expert

We feature a network of 450+ certified partners across the globe who are ready to help

Find an expert

Automate any workflow in your business

Sign up for a free account today. No credit card required, no time limits on free plan.