Performing Mail Merge Using Gmail and HTML Template

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. Like everything else you can perform Mail Merge without writing a single line of code. Whether you are reading data from Sheets or getting the data from a Google Forms, 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. 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 an HTML file as a template for our email body. 

Let’s get started;


The HTML template we use for this example looks like the below. As you can see there is just one token (dynamic value) in this file, which is {{tenantId}}.

however, you can add as many as required to the file. Remember any part of the document which you would like to be dynamically populated with values from your Flow (ex. Values coming from a Google Sheet, a Google Forms, etc.) need to be placed within double curly braces {{}}. We have stored this HTML file template on Google Drive.





  1. Drag drop a Generate HTML action, set the name to Generate Welcome Email, and configure it to point to the HTML template file on Google Drive     

  2. When you select the file, zenphi automatically extracts all the tokens (text within 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.                     

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

  4. Set the Body value to Payload of Generate Welcome Email action

  5. 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 using Gmail and by generating a dynamic email body using a HTML template, 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

Automate Google Workspace License Management Workflow

zenphi Use Cases, ,

Onboarding and offboarding staff is a very common process in organizations. That’s why those are amongst the most used use cases in process automation. However, there are still companies which have not fully automated their offboarding process or there are situations where the offboarding does not cover revoking licenses assigned to users.That means the company …

Read more
Automate Your Supplier Invoice Approval Workflow on Google Workspace

How-To , Sales Use Cases , zenphi Use Cases, , ,

Supplier invoicing is one of the many and recurring business processes that take place in a business setting. AccountingTools define supplier invoice as: “The bill issued by a vendor for goods delivered or services rendered to a customer. The recipient of a supplier invoice issues its own invoices to its customers, and so may refer …

Read more

Leave A Comment

Your email is safe with us.