Skip to main content

Mail Merge template in Make

The Mail Merge family is a Make Generate Document Single option that fills a classic Word mail-merge template, using MERGEFIELD tags, with your data and outputs a PDF or Word document. It is the fastest path to migrate an existing Microsoft Word mail-merge letter into an automated, code-free Make scenario.

Before You Start

Word template with MERGEFIELD tags
The sample simple_mail_merge_template.docx uses standard Word mail-merge fields. Each merge field name maps to a key in your data file.
Matching data file
Use sample_mail_merge_data.json (recommended), test.xml, or test.csv. The merge field names match the data keys.
PDF4me connection in Make
Create a PDF4me connection in Make and paste your API key. The same key works across every PDF4me module in your scenario.

Sample File Pack

Download the files below. One mail merge template plus matching data in JSON, XML, and CSV.

Make PDF4me Generate Document Using Template module showing Connection, Template Name set to sample template from the PDF4me repository, Document Data Type Json, Document Data Text empty, Document Data File mapped from prior step 2. Data, and Meta Data Json empty

Target configuration: Word mail-merge template + JSON in Document Data Text + PDF output.

What is the Mail Merge template template in Make?

The Mail Merge family reads a Word .docx built with classic MERGEFIELD tags and replaces each field with a value from your data. Because it is a .docx, you select PDF4me Word Template as the Template File Type in Make. Choose this family when you are moving an existing Word mail-merge document into an automated flow.

How do I configure Mail Merge template in Make?

Set the module fields as below. Required fields are marked with a red asterisk in the Make UI.

ParameterRequiredWhat it doesExample
ConnectionRequiredPDF4me connection for the scenario. Click Add to create one with your API key.My PDF4me connection
Template File TypeRequiredSet to PDF4me Word Template for this template family.PDF4me Word Template
Output TypeRequiredFormat of the generated document. PDF for a locked file or Word for an editable one.PDF
Template NameRequiredTemplate file name including extension. Map from the prior module file name output.simple_mail_merge_template.docx
TemplateRequiredTemplate file binary. Map from the prior module data output (for example 1. Data from Dropbox Download a File).1. Data
Document DataTypeRequiredChoose Json for JSON payloads (most common) or Xml when the upstream system returns XML.Json
Document Data TextConditionalInline JSON or XML data. Use when Document Data File is empty.sample_mail_merge_data.json
Document Data FileConditionalMapped data file from a prior module. Use when Document Data Text is empty.1. Data

Output

The module returns one bundle per run. The generated file is placed on the Doc Data output field.

FieldTypeWhat it contains
Doc DataBinaryThe generated PDF document. Map into a downstream Upload File or Send Email Attachment module.
File NameStringOutput filename based on Template Name with the extension matching Output Type.
Mime TypeStringMIME type of the generated document.

Production patterns

Common Make patterns for mail merge templatesReplace the manual test with these once the sample works.
Template from cloud storage
  1. Dropbox or Google Drive stores simple_mail_merge_template.docx.
  2. Download a File loads the template as binary.
  3. Generate Document Single maps Template Name and Template.
  4. Data is built from Sheets or a webhook as JSON.
Webhook to delivered PDF
  1. Webhook receives the record payload.
  2. Generate Document Single merges it with the template.
  3. Output Type is PDF.
  4. Send Email or Upload File delivers Doc Data.
Batch from a data source
  1. Search Records returns many rows.
  2. Iterator loops one record at a time.
  3. Generate Document Single runs once per record.
  4. Each file is uploaded to a per-record folder.

Frequently Asked Questions

Which Template File Type do I pick for a mail-merge .docx?+
Select PDF4me Word Template. A mail-merge document is a .docx, so it uses the Word Template family; the difference is that the fields are classic Word MERGEFIELD tags.
Can mail merge output PDF?+
Yes. Set Output Type to PDF for a locked file or Word for an editable one. The merge fields are replaced either way.
Do I need Microsoft Word to run this?+
No. Make and PDF4me perform the merge in the cloud. You only need Word if you want to edit the template file itself.
What data formats are supported?+
Set Document DataType to Json or Xml. The sample pack includes sample_mail_merge_data.json, test.xml, and test.csv.

For the underlying template engine, see the Aspose Words for .NET documentation and the Make data structures reference.