Guides › Mail merge with a personalized PDF attachment for each person

Mail merge with a personalized PDF attachment for each person

By Vishal Sai R, maker of RowPost · Updated 20 November 2026 · 9 min read

A normal mail merge sends the same email to many people with a few details changed: "Hi Priya", "Hi Daniel". But often each person also needs their own document: an invoice with their amount, a report card with their child's marks, an offer letter with their salary, a certificate with their name.

This guide explains how to send a mail merge from Google Sheets where every email carries a different, personalized PDF, and how that differs from attaching the same file to everyone.

Two kinds of attachments

Many real emails need both: for example, an offer letter made for each candidate, plus the same employee handbook for everyone.

How personalized PDFs are made

Every method, by hand or automatic, follows the same five steps for each row of your sheet:

  1. Make a copy of a template document (a Google Doc or Word file with placeholders like {{Name}}).
  2. Replace each placeholder with that row's values.
  3. Save the filled copy as a PDF.
  4. Attach the PDF to that person's email and send it.
  5. Delete the temporary copy, so your Drive doesn't fill up with hundreds of documents.

So what you need is a sheet (one row per person, with an email column) and a template whose placeholders match your column headers:

ClientEmailInvoice NoAmountDue Date
Acme Analyticsbilling@acme.exampleINV-1001₹45,00015 Dec 2026
Beta Labsaccounts@beta.exampleINV-1002₹18,50015 Dec 2026

…and a Google Doc invoice containing {{Client}}, {{Invoice No}}, {{Amount}} and {{Due Date}}.

Method 1: RowPost (no code)

RowPost is a Google Sheets add-on built for exactly this. (Disclosure: we make it.)

  1. Open your sheet and click Extensions → RowPost → Open RowPost.
  2. Write the subject and message with placeholders, like Invoice {{Invoice No}} – due {{Due Date}}.
  3. Under Personalized PDF, tick Make a personalized PDF for each person and choose your Google Doc or Word template. Set the PDF file name, for example Invoice {{Invoice No}} – {{Client}}.
  4. Need the same file for everyone too? Add it under Files for everyone, from Drive or your computer.
  5. Preview a few rows, Send test to me, then Send to all or schedule it. The status column shows what was sent to whom.

There are ready-made templates for invoices, report cards, offer letters, certificates and tickets.

Get RowPost

Method 2: A free Apps Script

Google Apps Script can run the five steps above for free. The script in our certificate guide works for any document: change the file name and the email text, and point it at your invoice, report card or letter template.

Keep in mind that scripts on a free Gmail account can email about 100 recipients a day (about 1,500 on Google Workspace), each run stops after 6 minutes, and the script needs permission to manage your whole Drive. Test on a copy of your sheet first.

Method 3: Each person's file already exists

Sometimes the PDFs are already made, for example payslips exported from your accounting software, and you only need to send each one to the right person. Put the files in Drive, add a File ID column to your sheet (the long code in each file's link), and use a script like this:

/**
 * Emails every row a file that already exists in Drive.
 * Columns needed: Name, Email, File ID (the long ID from the file's Drive link).
 */
function sendExistingFiles() {
  const sheet = SpreadsheetApp.getActiveSheet();
  const [headers, ...rows] = sheet.getDataRange().getDisplayValues();
  const col = (name) => headers.indexOf(name);

  rows.forEach((row) => {
    const email = row[col('Email')];
    const fileId = row[col('File ID')];
    if (!email || !fileId) return;
    const file = DriveApp.getFileById(fileId);
    GmailApp.sendEmail(email, 'Your document, ' + row[col('Name')],
      'Hi ' + row[col('Name')] + ',\n\nYour document is attached.',
      { attachments: [file.getBlob()] });
  });
}

RowPost doesn't do this kind yet: it makes the PDFs from your template, or attaches the same files to everyone.

Tips for any method

Send them all in one click

RowPost fills a PDF for every row of your Google Sheet and emails it from your Gmail, with a preview, test sends and a status column. Free for 50 emails a day.

Get RowPost See the templates

More guides