Mail Merge
How to Preview Mail Merge Emails Before Sending
Published 2026-09-20 · CSV Sender
CSV Sender previews the first sendable row—From, To, Subject, Body—with promotional footer sample when applicable, matching getCampaignEmailPreview behavior.
Quick answer
To preview mail merge emails in CSV Sender, open the campaign wizard after CSV import and load the email preview. The app loads the first message in status PENDING or SCHEDULED (ordered by created_at) and shows From (connected Gmail display name and address), To, Subject, and Body exactly as Gmail will receive them—plus a sample unsubscribe footer when the campaign type is PROMOTIONAL.
What the preview is not
It is not a merge-template renderer. CSV Sender does not evaluate {{fields}}. If you still use merge tokens in cells, preview displays them literally—your signal to fix the export (mail merge variable errors).
It is also not a send: promotional previews append a footer using a preview token that is not valid for production unsubscribe handling.
How preview maps to the codebase
getCampaignEmailPreview selects one row:
- Filters
messageswherecampaign_idmatches andstatusis PENDING or SCHEDULED - Orders by
created_atascending, limit 1 - Returns an error if no sendable messages exist ("No sendable messages to preview.")
From resolves from the campaign’s linked gmail_accounts row when selected; otherwise shows "Gmail sender not selected".
Body uses stored body text. For PROMOTIONAL campaigns, preview appends the same promotional footer helper used at send time, with buildUnsubscribeUrl("preview-token-not-for-sending") so you see layout without creating a live token.
Schedule preview companion
The wizard also offers a daily send distribution preview via getCampaignSchedulePreview: counts PENDING and SCHEDULED messages and buckets them by local date using the same previewDistribution logic as scheduling (schedule emails from CSV, calculate email campaign duration).
Refresh after changing daily limits or working hours.
Recommended QA flow
- Upload CSV with validate CSV before emailing checks complete.
- Connect Gmail send-only (Gmail OAuth for email sending).
- Load email preview—confirm To is not your own address unless intended.
- Load schedule preview—confirm finish date matches expectations (email sending window).
- Set campaign RUNNING only after both previews look correct.
Mail merge users: what to verify in preview
- No visible
{{tokens - Subject line length acceptable in Gmail
- Multiline bodies preserved (multiline text in CSV)
- Promotional footer present only when message type is promotional
- Suppressed addresses never appear as queued rows (email suppression list)
Example
Campaign with 400 rows: preview shows alex@example.com first because that message was inserted earliest. If you sorted CSV differently before export, earliest created row still wins—reorder export if a specific row must be spot-checked.
FAQ
Can I preview row 200?
Preview shows the first sendable row only—open the CSV source for other rows or send a tiny test campaign.
Why does footer link look odd in preview?
Promotional preview uses a non-sending token by design.
Does preview include CC or attachments?
CSV Sender sends single-recipient prepared mail from three columns—no attachments in v1.
Will preview update after pause/resume?
Reload preview; underlying rows remain unless rescheduled (resume email queue).
What statuses count as sendable for preview?
PENDING and SCHEDULED—not SENT or FAILED (email status scheduled).
Related reading
Coordinating preview with schedule review
Email preview and schedule preview answer different questions. Email preview validates copy and sender identity; schedule preview validates calendar spread (calculate email campaign duration). Load both before RUNNING so stakeholders see neither wrong text nor impossible same-day volume.
If email preview errors with "No sendable messages to preview," all rows may be invalid, suppressed, or already terminal—check import issues and statuses (email status failed). If schedule preview shows zero buckets while rows exist, confirm messages are still PENDING or SCHEDULED (email status scheduled).
Treat preview as the last human gate before automated Gmail sends begin—after validate CSV before emailing and suppression scrub (email suppression list).
Sharing preview results with reviewers
Screenshot or copy the preview into approval tickets so legal sees the exact promotional footer wording. Note that unsubscribe URLs in preview use a non-production token—recipients receive live tokens only on SENT promotional mail. Non-promotional campaigns skip footer injection entirely while still showing raw body text from the CSV (send prepared emails).
Production send discipline
Treat each CSV upload as a production release: freeze copy, validate structure, dedupe recipients, sync suppression, preview representative rows, and only then set campaigns RUNNING. CSV Sender’s model—prepared email, subject, and body columns, paced scheduling, workspace-level opt-outs, duplicate guards, and bounded Gmail retries—rewards teams that invest in export quality upstream rather than debugging merge tokens downstream. When results look wrong, start from message statuses and skip reasons before blaming Gmail; most surprises trace to data preparation (validate CSV before emailing), list hygiene (remove duplicate emails from CSV), or sender OAuth (Gmail OAuth for email sending). Revisit scheduling articles if timing—not content—is the issue (schedule emails from CSV).
Related articles
Email Data
Validate CSV Before Emailing: Checklist for Prepared Send Files
Validate CSV email files for required columns, encoding, duplicates, and row-level errors before they hit the Gmail send queue.
CSV Email
Send Prepared Emails From a Spreadsheet Export
Treat each CSV row as a finished email—subject and body already written—and deliver through Gmail without merge templates.
Email Operations
What Does Pending Mean in an Email Queue?
PENDING means a validated CSV row is queued as a message but has no scheduled_at yet—waiting for campaign start or scheduling pass.
Email Scheduling
Schedule Emails from CSV: Paced Gmail Sending for Prepared Rows
Assign scheduled send times to CSV rows using daily limits, weekdays, and business hours—without templates or merge fields.
Permalink: http://localhost:3000/blog/preview-mail-merge-emails