How to Mail Merge in Google Sheets with Attachments (Static & Dynamic Files)
GuidesOctober 15, 202611 min read
Learn how to send static and dynamic attachments in Google Sheets mail merge using Mailvern's email editor, conditional rules, scheduling, and automated autoruns.
Sending personalized emails from Google Sheets is simple when you only need to replace text variables such as {{First Name}} or {{Company}}. However, once you need to attach files—such as contracts, welcome kits, brochures, or customized documents—traditional mail merge tools can become limiting.
Some add-ons rely on cumbersome Gmail-draft workarounds, make it difficult to send different files to different recipient groups, or require custom Google Apps Script code that can be difficult to maintain.
In this guide, you’ll learn how to:
- The difference between static attachments and dynamic (conditional) attachments.
- Set up an attachment-based mail merge with Mailvern.
- Send different attachments to different recipients using conditional row filtering.
- Choose Send Now, Schedule Later, or Autorun to deliver your campaign.
- Follow attachment-size, deliverability, and spam-prevention best practices.
Static vs. Dynamic Attachments: What Is the Difference?
Before you configure your spreadsheet, decide which type of attachment your workflow requires:
1. Static (Universal) Attachment
[All Recipients] ─── receives ───► Same File (e.g., Company Profile.pdf)
2. Dynamic (Conditional) Attachment
[Row A: Tier = Pro] ─── receives ───► Pro_Guide.pdf
[Row B: Tier = Starter] ─── receives ───► Starter_Guide.pdf
[Row C: Status = Pending] ─── receives ───► Payment_Instructions.pdf
1. Static attachments
Every recipient receives the same file, while the email body can still be personalized for each person. Examples include:
- A product catalog or pricing sheet sent to event attendees.
- A standardized company onboarding handbook sent to new hires.
- A single PDF whitepaper sent to webinar leads.
2. Dynamic (conditional) attachments
Different recipients receive different files based on values in your spreadsheet, such as customer tier, department, product choice, or regional office. Examples include:
- Sending a Bronze, Silver, or Gold sponsorship agreement based on Column D (
Sponsorship Tier). - Sending an English or Spanish user manual based on Column E (
Preferred Language). - Sending a customized scope of work based on Column F (
Service Type).
How Dynamic Attachments Work in Mailvern (No Apps Script Required)
With traditional add-ons such as YAMM, email creation may depend on Gmail drafts, forcing you to switch between Gmail and Google Sheets to manage your workflow.
Mailvern operates differently:
- Dedicated in-app email editor: Design and format your templates directly in Mailvern. You don’t need to create email drafts in your Gmail inbox.
- Template-level file attachments: Attach the relevant document—such as a PDF, DOCX file, spreadsheet, or slide deck—to its template. The files are uploaded to your Google Drive.
- Row-level conditional filtering: Use spreadsheet column values to select the rows that qualify for each template. For example, if Column D equals
Enterprise, send the Enterprise template. - Flexible sending options: Send immediately with Send Now, choose a future delivery time with Schedule Later, or automate recurring processing with Autorun.
Step-by-Step: Setting Up Conditional Attachments
Step 1: Structure your Google Sheet
Make sure your Google Sheet has clear column headers and a column that identifies which document or template each contact should receive.
| First Name | Company | Package (Column D) | |
|---|---|---|---|
| Jordan | jordan@acme.com | Acme Corp | Enterprise |
| Priya | priya@techflow.io | TechFlow | Starter |
| Marcus | marcus@apex.co | Apex Global | Growth |
| Elena | elena@summit.org | Summit Inc | Enterprise |
Note: You don’t need to create or maintain a mail-status column yourself. Mailvern automatically creates and updates its status column to track email activity, including whether an email was sent, skipped, or opened.
Step 2: Install Mailvern
In Google Sheets, go to Extensions → Add-ons → Get add-ons. Search for Mailvern, then select Install. You can also install it from the Google Workspace Marketplace.
When you select Install, follow the prompts to continue. You may be asked to confirm your name and email address before reviewing the permissions Mailvern needs to operate. Review and approve the requested permissions to complete installation. Once installed, you’ll find Mailvern in the Extensions menu in Google Sheets.
Step 3: Create your email templates in Mailvern's editor
In Google Sheets, open Extensions → Mailvern → Open Email Editor.
Create distinct templates for each customer segment (for example):
Template A: "Enterprise Welcome"
- Subject:
Welcome to the Enterprise Program, {{First Name}} - Body: Custom messaging detailing dedicated account managers, priority SLA, and custom integrations.
- Attachment: Upload
Enterprise_Onboarding_Kit.pdfdirectly inside Mailvern's editor.
Template B: "Starter Welcome"
- Subject:
Getting Started with Your Starter Plan, {{First Name}} - Body: Custom onboarding tips for small teams.
- Attachment: Upload
Starter_Quickstart_Guide.pdfdirectly inside Mailvern's editor.
Each template now has its own attachment and can use spreadsheet variables such as {{First Name}} and {{Company}} to personalize the message.
Click Save, then select Test to send a test email to your own address. Check the message in Gmail to confirm that the variables have been replaced with values from the first data row.
If a variable is missing, its name may contain a typo or an extra space. Mailvern removes variables it cannot match, so use the variable dropdown to insert a valid variable from your sheet’s available column headers.
Step 4: Filter rows with conditional rules
Once your templates are ready, open Extensions → Mailvern to launch the sidebar. Use Mailvern’s conditional filtering to choose the audience for each campaign:
In Mailvern sidebar:
- Select Template A (Enterprise Welcome).
- Select the Email column and the Name column.
- If needed, specify a row range to limit the campaign to particular rows.
- Under Conditions, set a filter. For example:
Column D (Package) EQUALS "Enterprise" - Mailvern scans the sheet and selects only the matching rows—in this example, Jordan and Elena.
Repeat this setup for your Starter and Growth segments with their respective templates and attachments.
Sending Options: Send Now, Schedule Later, and Autorun
Once you’ve configured your template and conditional rule, you can send messages in one of three ways:
┌────────────────────────────────────────────────────────────────────────┐
│ MAILVERN DISPATCH MODES │
├─────────────────┬──────────────────────┬───────────────────────────────┤
│ 1. Send Now │ Immediate dispatch │ Sends matching rows instantly │
├─────────────────┼──────────────────────┼───────────────────────────────┤
│ 2. Schedule │ Time-targeted send │ Queues send for future date │
├─────────────────┼──────────────────────┼───────────────────────────────┤
│ 3. Autorun │ Automated background │ Periodically scans rows and │
│ │ trigger │ sends when conditions are met │
└─────────────────┴──────────────────────┴───────────────────────────────┘
1. Send Now
Send personalized emails and their attachments immediately to every row that currently matches your conditions. This option is useful for manual batches, time-sensitive notices, and one-time announcements.
2. Schedule Later
Choose a future date and time for your campaign. Mailvern queues the campaign and starts sending when the scheduled time arrives. This is useful when coordinating across time zones or planning delivery for a specific time of day.
3. Autorun (Hands-Free Spreadsheet Automation)
Autorun turns your Google Sheet into an automated workflow. When enabled, Mailvern checks the sheet at its configured frequency, such as every few hours or once a day:
- When a new row is added—for example, through a Google Form or CRM sync—and its
Packagevalue isEnterprise, Autorun can send the Enterprise template with its attached PDF. - Mailvern automatically creates and updates its status column to record whether each email was sent, skipped, or otherwise processed. You don’t need to create or update this column yourself.
The 1-hour Google-enforced limitation on Autorun
If you set up multiple automated workflows on the same sheet—for example, one Autorun job for Enterprise contacts and another for Starter contacts—keep Google’s trigger limitations in mind:
Important: Google Apps Script applies execution-frequency limits to time-driven triggers. When configuring multiple separate Autorun tasks in the same Google Sheets workflow, schedule each job at least one hour apart.
Spacing out Autorun triggers can help your automations run more reliably and reduce the risk of Google’s execution limits affecting them.
The Alternative: Writing Google Apps Script (And Why It Fails)
You can build an attachment-based mail merge with Google Apps Script, but doing so requires custom code. A simplified example looks like this:
function sendMailMergeWithAttachments() {
const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
const data = sheet.getDataRange().getValues();
const fileId = "1a2b3c4d5e6f7g8h9i0j..."; // Google Drive File ID
const attachment = DriveApp.getFileById(fileId).getAs(MimeType.PDF);
for (let i = 1; i < data.length; i++) {
const [firstName, email, company, packageType, status] = data[i];
if (packageType === "Enterprise" && status !== "Sent") {
const body = `Hi ${firstName},\n\nPlease find your enterprise agreement attached.\n\nBest,\nTeam`;
GmailApp.sendEmail(email, "Your Agreement", body, {
attachments: [attachment],
name: "Enterprise Team"
});
sheet.getRange(i + 1, 5).setValue("Sent");
Utilities.sleep(1000); // Throttling delay
}
}
}
Why custom scripts can be difficult to maintain
- Google Drive permission issues: If access to a Drive file changes,
DriveApp.getFileById()may fail and interrupt the campaign. - Gmail sending quotas: A custom script may not include quota monitoring. Exceeding your account’s sending limits can interrupt sending and require you to investigate the error.
- Execution timeouts: Apps Script executions have time limits. Large recipient lists and sizable attachments can cause a run to time out before the campaign is complete.
- Limited visual editing: Script-based emails often require HTML to be written or maintained in code, which can make branded layouts harder to manage.
Mailvern’s built-in editor and condition builder provide a no-code alternative to maintaining a custom script, while working with your authorized Google account.
File Size, Quotas, and Deliverability Best Practices
Attachments introduce a few technical considerations that can affect whether your emails are delivered successfully.
1. File size ceilings vs. deliverability recommendations
- Gmail’s size limit: Gmail allows up to 25 MB per message, including the message body and attachments.
- The encoding overhead: Base64 encoding can increase a file’s size by about 33%. For example, an 18 MB PDF may approach 24 MB when encoded for email.
- Recommended file size: Keep attachments under 3–5 MB when possible. Some corporate mail servers may reject messages that exceed their own size limits.
2. File types to avoid
To protect inbox placement and prevent spam filtering:
- Recommended:
.pdf(the gold standard for contracts, invoices, and guides). - Acceptable:
.csv,.xlsx,.png,.jpg. - High spam risk:
.zip,.tar.gz,.rar(frequently flagged by spam filters as potential malware vectors). - Prohibited by Gmail:
.exe,.bat,.js, or any executable format.
Before sending a large campaign, review your message with Mailvern’s Email Spam Checker for potential content and formatting issues.
3. Understanding daily sending limits
Every email sent through a Google Sheets mail merge counts toward your Google account’s daily sending quota:
- Free Gmail accounts (
@gmail.com): 500 emails per rolling 24-hour period. - Google Workspace accounts (
@yourcompany.com): 2,000 emails per rolling 24-hour period.
For more details about quotas and sending practices, read our guide to Gmail Sending Limits and Workarounds.
Comparison: Mailvern vs. Gmail Merge vs. Google Apps Script
| Feature | Native Gmail Mail Merge | Google Apps Script | Mailvern |
|---|---|---|---|
| Dedicated Email Editor | No (Gmail Compose) | No (Raw code / HTML) | Yes (Built-in Editor) |
| Static Attachments | Yes (manual upload) | Yes (requires Drive coding) | Yes (one-click attach) |
| Dynamic Attachments | No | Requires complex logic | Yes (template conditions) |
| Send Now | Yes | Yes (manual run) | Yes |
| Schedule Later | Limited (individual drafts) | Requires custom trigger code | Yes (built-in) |
| Autorun (Recurring automation) | No | Requires manual time triggers | Yes (with 1h safety buffer) |
| Email Status Tracking | Limited | Must be coded manually | Automatically created and updated |
| No-Code Setup | Yes | No (requires JavaScript) | Yes (100% no-code) |
Frequently Asked Questions
Can I personalize the body of the email while sending an attachment?
Yes. Mailvern’s email editor supports merge tags such as {{First Name}}, {{Company}}, and {{Due Date}} in both the subject and body, including emails with attachments.
How do I send different files to different people in Google Sheets?
Create a separate template in Mailvern’s email editor for each document, then apply a condition to select the rows that should receive it. For example, rows where Column D = Enterprise can receive Template A, while rows where Column D = Starter receive Template B.
What is the minimum time interval for Autorun in Google Sheets?
Google Apps Script applies limits to time-driven triggers. According to this workflow’s guidance, separate Autorun jobs on the same spreadsheet should be scheduled at least one hour apart.
Should I attach a file directly or share a Google Drive link?
For a contract or invoice under 5 MB, attaching a PDF can be a practical option. For larger files, consider storing the file in Google Drive or another cloud service and including a link in the email instead.
Where can I check if my email content will land in spam?
Use Mailvern’s free Email Spam Checker and Email Subject Line Checker to review your copy for potential spam signals, formatting issues, and subject-line improvements before scheduling.
Summary and Next Steps
Sending attachments through a Google Sheets mail merge doesn’t have to mean maintaining custom Apps Script code or juggling Gmail drafts.
- Create your templates and add attachments in Mailvern’s dedicated email editor.
- Apply conditional rules to spreadsheet columns so each customer group receives the appropriate template and attachment.
- Choose Send Now for immediate delivery, Schedule Later for a planned send, or Autorun for recurring automation. If you configure separate Autorun jobs, follow the one-hour spacing guidance described above.
To learn more about conditional logic and multi-tier workflows, read our guides to Conditional Mail Merge From Google Sheets and Automating Emails Based on Cell Values.
