Sending Merged PDFs via Email Campaigns
Mergram’s email campaign feature lets you send personalized PDFs as attachments — directly from the merge workflow. Instead of downloading merged PDFs and emailing them one by one, you can automate the entire process: merge, attach, personalize, and send in a single operation.
Prerequisites
Before setting up an email campaign, make sure you have:
- An SMTP server with credentials (host, port, username, password)
- A PDF template uploaded to Mergram
- A spreadsheet with recipient data — must include an email column
- A Mergram account with sufficient credits for your campaign size
Choosing an SMTP provider
If you don’t have a dedicated SMTP service, Gmail works for small campaigns (up to ~500 emails/day). For larger campaigns, use a transactional email provider like SendGrid, Mailgun, or Amazon SES for better deliverability and higher sending limits.
How It Works
The email campaign workflow combines PDF generation with email delivery:
- Merge: Generate personalized PDFs from your template and data
- Email: Each PDF is attached to a personalized email
- Send: Emails go through your SMTP server
- Track: Monitor delivery status in real time
This means every recipient gets a unique PDF with their own data — names, amounts, IDs, QR codes — delivered directly to their inbox.
SMTP Configuration
Connect any standard SMTP server. Here are common provider settings:
| Provider | Host | Port | Notes |
|---|---|---|---|
| Gmail | smtp.gmail.com | 587 | Use App Password, not account password |
| SendGrid | smtp.sendgrid.net | 587 | Username: apikey (literal), password: your SendGrid API key |
| Mailgun | smtp.mailgun.org | 587 | Use your domain credentials |
| Amazon SES | email-smtp.*.amazonaws.com | 587 | Region-specific hostname |
| Postmark | smtp.postmarkapp.com | 587 | Use Server API token |
| Office 365 | smtp.office365.com | 587 | Requires licensed mailbox |
Gmail App Password
To use Gmail as your SMTP server, you need to create an App Password in your Google Account (Security → 2-Step Verification → App passwords). Your regular Gmail password will not work if 2FA is enabled.
Email Template Personalization
Use the rich text editor to craft your email body with merge fields. Any column header from your spreadsheet can be used as a placeholder:
| Merge Field | Replaced With |
|---|---|
[[name]] | Recipient’s full name |
[[email]] | Recipient’s email address |
[[company]] | Company name |
[[amount]] | Invoice amount |
[[dueDate]] | Payment due date |
| Any column header | The value from that column for each row |
Subject line example: Your invoice for [[month]] — [[company]]
Body example:
Hi [[name]],
Please find your invoice for [[month]] attached. The amount due is [[amount]], payable by [[dueDate]].
If you have any questions, don't hesitate to reach out.
Best regards,
The Billing Team
The rich text editor supports bold, italic, lists, and links. You can also insert merge fields anywhere in the body by typing [[ and selecting from the autocomplete list.
Preparing Your Recipient Data
Your spreadsheet must have an email column — this is required for the campaign. Additional columns become available as merge fields:
| Name | Company | Amount | Due Date | |
|---|---|---|---|---|
| Alice Chen | alice@acme.com | Acme Corp | $1,250.00 | 2025-02-15 |
| Bob Martinez | bob@globex.com | Globex Inc | $3,400.00 | 2025-02-15 |
| Carol Johnson | carol@initech.com | Initech | $890.00 | 2025-03-01 |
Email column is required
Every row must have a valid email address. Rows with missing or invalid emails will be skipped during sending. Check your data for typos before starting the campaign.
Security
Mergram takes email security seriously:
- SMTP passwords are encrypted with AES-256-GCM — they cannot be read in the database
- Connection settings are stored securely per team
- Email credentials are never exposed in the UI or API responses
- PDFs are generated server-side and sent directly — no browser-based credential handling
Tracking Campaign Progress
After launching your campaign, track its progress from the Jobs panel:
| Status | Meaning |
|---|---|
| Queued | Email is waiting to be sent |
| Sent | SMTP server accepted the email |
| Opened | Recipient opened the email (detected via tracking pixel) |
| Clicked | Recipient clicked a link in the email |
| Failed | Delivery failed (bounced, invalid address, SMTP error) |
Failed emails show the error reason so you can identify and fix data issues. Common failure causes include invalid email addresses, full mailboxes, and SMTP rate limiting. Re-send a corrected campaign after fixing the data.
You can export tracking data (delivery status, open timestamps, click timestamps) as a CSV file for reporting and analysis.
When to Use Email Campaigns
Email campaigns are ideal when you need to deliver personalized documents directly to recipients:
- Invoices and billing — Monthly invoices with per-client amounts and due dates
- Employee documents — Pay slips, tax forms, benefit statements
- Event communications — Tickets, schedules, personalized itineraries
- Client reports — Personalized performance reports or account summaries
- Legal notices — Contracts, NDAs, compliance documents
- Certificates — Course completions, awards, credentials
Best Practices for Email Deliverability
- Use a dedicated SMTP provider — Gmail is fine for testing, but transactional providers (SendGrid, SES, Mailgun) provide better delivery rates
- Warm up your sending domain — Start with smaller batches and increase gradually
- Verify your domain — Set up SPF, DKIM, and DMARC records for your sending domain
- Personalize subject lines — Emails with personalized subjects have higher open rates
- Test with a small batch first — Send to 5–10 internal addresses before launching a full campaign
- Keep attachments under 10MB — Large PDFs may be blocked by some email providers
- Include a plain-text fallback — Mergram generates this automatically from your HTML body
Common Issues and Troubleshooting
SMTP authentication failed: Double-check your host, port, username, and password. For Gmail, ensure you’re using an App Password. For SendGrid, use apikey as the username (the literal string, not your actual API key) and your SendGrid API key as the password.
Emails going to spam: Set up SPF, DKIM, and DMARC records for your sending domain. Most transactional email providers have setup guides for this.
Rate limiting errors: If your SMTP provider enforces rate limits (e.g., Gmail’s 500/day), spread your campaign over multiple days or switch to a higher-limit provider.
Missing attachments: Ensure your PDF template has fields that map correctly to your data. Empty merges produce empty PDFs, which some email clients may strip.
Get Started
Configure your SMTP settings in Mergram, upload a template and spreadsheet, and send your first email campaign in minutes. Start with a small test batch to verify everything works before scaling up.