Guides › Mail merge with a personalized PDF attachment for each person
Mail merge with a personalized PDF attachment for each person
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
- The same file for everyone: a brochure, a timetable, a policy document. Every email gets an identical copy. Most mail merge tools can do this.
- A personalized file for each person: each PDF is different, filled with that person's details. This is what this guide is about, and fewer tools do it.
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:
- Make a copy of a template document (a Google Doc or Word file with placeholders like
{{Name}}). - Replace each placeholder with that row's values.
- Save the filled copy as a PDF.
- Attach the PDF to that person's email and send it.
- 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:
| Client | Invoice No | Amount | Due Date | |
|---|---|---|---|---|
| Acme Analytics | billing@acme.example | INV-1001 | ₹45,000 | 15 Dec 2026 |
| Beta Labs | accounts@beta.example | INV-1002 | ₹18,500 | 15 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.)
- Open your sheet and click Extensions → RowPost → Open RowPost.
- Write the subject and message with placeholders, like
Invoice {{Invoice No}} – due {{Due Date}}. - 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}}. - Need the same file for everyone too? Add it under Files for everyone, from Drive or your computer.
- 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.
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
- Name files clearly. "Invoice INV-1001 – Acme Analytics.pdf" is much easier for the recipient than "document (3).pdf".
- Mind the size limit. Gmail allows about 25 MB per email in total. A one-page PDF is usually under 100 KB, but large images in your template add up.
- Stay within daily limits. About 500 emails a day for personal Gmail and 2,000 for Google Workspace when sending through Gmail; scripts have lower limits (see above).
- Always send a test to yourself first and open the PDF: check the names, numbers and layout.
- Keep a record of what was sent: a status column with the date makes it easy to answer "did you send mine?".
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