How to Use Variable Fields in your Mail Merge Email Templates

Published in: Mail Merge for Gmail

Mail Merge for Gmail lets you send the same email message to a group of recipients but as separate emails without having to use CC or BCC. You can use variable fields in your email template - these are enclosed in double curly braces like {{First Name}} - and the fields are directly mapped to columns of the Google Spreadsheet.

For instance, if you have a column in the spreadsheet as First Name, you can put {{First Name}} in the Gmail draft (variable enclosed in double curly braces) and it will be dynamically substituted with the actual value of the first name in the outgoing email messages.

mail merge formatting error

Troubleshooting {{Variables}} in Mail Merge

Mail Merge will show an error when it cannot substitute the placeholder (or variable name) with actual values from the sheet. This happens in few situations:

  1. The variable name used in the Gmail template does not exactly match the column title in the Google Spreadsheet.
  2. There’s no corresponding column in the Google sheet for the {{variable}} used in your Gmail template.
  3. The variable name in the Gmail template is formatted with multiple styles. For instance, if the variable name is {{Postal Address}}, you cannot have Postal using one style and Address using another formatting style.

How to Fix the Gmail Formatting Issue

The fix is relatively simple.

Open the corresponding draft in your Gmail Account, select the variable name with your mouse and click the Remove Formatting icon as show in the screenshot below.

Alternatively, you can manually remove the variable and type it again. This will ensure that the entire variable is formatted in a single style.

fix formatting issue

📮  Subscribe to our Email Newsletter for Google tips and tutorials!
Published in: Mail Merge for Gmail

Looking for something? Find here!

Meet the Author

Web Geek, Google Developer Expert
Amit Agarwal

Amit Agarwal is a Google Developer Expert in Google Workspace and Google Apps Script. He holds an engineering degree in Computer Science (I.I.T.) and is the first professional blogger in India. He is the developer of Mail Merge for Gmail and Document Studio. Read more on Lifehacker and YourStory

Get in touch

Google Add-ons

Do more with your Gmail and GSuite account

We build bespoke solutions that use the capabilities and the features of Google Workspace for automating business processes and driving work productivity.

  1. Mail Merge with Attachments
    Send personalized email to your Google Contact with a Google Sheet and Gmail
  2. Save Emails and Attachments
    Download email messages and file attachments from Gmail to your Google Drive
  3. Google Forms Email Notifications
    Send email notifications to multiple people when a new Google Form is submitted
  4. Document Studio
    Create beautiful pixel perfect documents merging data from Google Sheets and Google Forms
  5. Creator Studio for Google Slides
    Turn your Google Slides presentations into animated GIFs and videos for uploading to YouTube