Mail Merge Using Gmail and Google Docs

August 9, 20200 CommentHow-To

One of the most popular tasks in Gmail is performing Mail Merge. There are many ways to perform Mail Merge, and also many good tools out there to perform this. Some require Apps Script/some don’t.


At zenphi we have tried to make performing Mail Merge as powerful and yet painless as possible using Gmail. Like everything else you can perform Gmail Mail Merge without writing a single line of code. Whether you are reading data from Sheets or getting the data from a Google Forms, Gmail Mail Merge can be in just a few steps.


On top of that, zenphi enables you to perform Mail Merge and attach files to the emails, if required.


The email body template can

  1. Be dynamically constructed in zenphi

  2. Dynamically constructed using a HTML file template

  3. Dynamically constructed using a Google Docs document as a template


In this example. We are going to use a Google Docs Document as a template for our email body. 


Let’s get started;


We have prepared a Google Docs Document to use as a template for the email we send out. You can see the document in the image below. 


As you can see there are multiple tokens (dynamic values) in the document. Anything wrapped with double curly braces is a token and can be dynamically populated by the values within a Flow (ex. Values coming from a Google Sheet, a Google Forms, etc.).


    1. Drag drop a Generate Document action, set the name to Generate Email Body, and configure it to point to the Google Docs document you’d like to us as the template  

    1. When generating a dynamic document based on this template, zenphi needs to first store the new document on Google Drive. Configure where you’d like the generate document to be stored under the Destination File section

    2. From the Other File Types section enable Generate HTML option

    3. When you select a template document, like we did in step 1, zenphi automatically extracts all the tokens (text wrapped with curly braces) and displays them under the Token Mapping section. Here you can assign a static or a dynamic value to each token. To assign a dynamic value, you can click on the picker icon on the right side of control or just type @ to see a list of available values to use.           


  1. Drag drop a Gmail Send Email action, configure To, and Subject of the action

  2. Set the Body value to HTML Payload of Generate Email Body action

  3. You are all set. Publish and run your Flow.


As you can see in just a few steps you have been able to perform a Mail Merge Gmail using a Google Docs Document as the template for your email body without needing to write or copy paste any code.


While this is very basic, but useful Flow, you can easily extend the solution by adding if conditions, updating the Sheets when an email is sent, saving the email content to Google Drive, etc. And that’s where the power of zenphi lies. You can even easily seek an approval before an email is sent. All with just a few drag drops and configuration. 


Get started with zenphi for free and see how you can bring the magic of zenphi to your business.

Related post

Do More When You Automate Google Workspace for Education Workflows

Education Use Cases , How-To , zenphi Use Cases, , , , ,

When you automate your Google Workspace for Education workflows, you’re future-proofing your operations. As an account administrator, automating your existing Google Workspace Workflows helps boost your teams’ productivity 10x. This way, they can focus on things that matter because most of the mundane and repetitive tasks are taken care of. Does creating an individual file folder …

Read more
Empower Your Team With Gmail Workflow Automation

General , How-To, , ,

Gmail by Google is no doubt one of the most-relied upon email services out in the market. And adding Gmail Workflow automation will supercharge your emailing system. If you are reading this article, then you are looking for ways to elevate your Gmail experience. Despite being a powerhouse tool, Gmail can do more if you add …

Read more

Leave A Comment

Your email is safe with us.