Mail Merge
How Does Email Mail Merge Work?
Published 2026-09-20 · CSV Sender
Walk through token substitution, column mapping, and Gmail delivery for classic mail merge—and where prepared CSV sending skips the merge runtime.
Quick answer
How email mail merge works: author a template with merge fields, connect a row-oriented data file, map columns to fields, then for each row the merge engine renders subject/body and hands off to a mail transport. Errors usually happen at mapping (wrong column) or render (missing token). CSV Sender skips rendering—operators must upload already-rendered subject and body values (send prepared emails).
Step 1 — Template design
Templates live in Google Docs, Gmail compose extensions, or HTML files. Fields appear as {{Name}} or merge syntax specific to the vendor. Conditional sections (“if Region=EMEA”) require advanced merge engines CSV Sender does not provide (mail merge without templates discusses the opposite approach).
Step 2 — Data preparation
Rows need stable keys—usually email address plus attribute columns. Export UTF-8 CSV with headers; validate before any send (format CSV for email sending).
Duplicate addresses cause duplicate merges unless deduped (find duplicate emails in CSV).
Step 3 — Mapping
The merge UI links {{FirstName}} → column first_name. Misaligned headers produce blank tokens or literal {{FirstName}} embarrassment.
Prepared CSV workflows instead put the greeting directly in body—no mapping at send time.
Step 4 — Rendering
Engine loops rows, substitutes tokens, may apply HTML wrapper. Some tools render in browser memory; others server-side.
CSV Sender’s loop reads final strings and schedules Gmail API sends (schedule emails from CSV).
Step 5 — Delivery
Workspace mail merge uses Google-controlled sending paths with documented caps (gmail mail merge guide). CSV Sender uses OAuth gmail.send per connected mailbox (Gmail OAuth for email sending).
Failure and testing patterns
Send five-row proofs before 2,000-row launches. Preview merged HTML in merge tools; preview CSV rows in CSV Sender validators.
For different subjects per recipient, merge must expose subject templates (mail merge different subject) or you prewrite subjects (different subject each email).
Security and scopes
Merge add-ons sometimes request inbox read scopes to track replies. CSV Sender stays send-only (send Gmail without reading inbox).
FAQ
Can merge send attachments per row?
Depends on merge tool; CSV Sender standard columns are email/subject/body text.
Does merge pace sends?
Often bulk; CSV Sender paces natively (paced email sending).
Apps Script merge?
Custom code path—compare Gmail CSV sender options.
API vs merge?
Read Gmail API vs mail merge.
Sheets live link?
CSV Sender does not import Sheets directly.
Related reading
Rendering environment gotchas
HTML merge templates may look different in Docs preview vs Gmail dark mode. Plain-text prepared rows avoid some surprises but lose bold formatting. Choose consciously before export. CSV Sender sends the body string you provide—no automatic HTML wrapper unless your content includes HTML.
Loop semantics
Merge engines iterate rows in stable order. CSV Sender scheduling also respects row order when assigning timestamps, but send order follows schedule, not necessarily CSV row index. Operators expecting strict FIFO by row number should sort CSV intentionally before upload if business rules require it.
Testing merge mappings
Always include a row with empty optional fields and a row with unicode characters to stress-test mapping. Prepared CSV workflows should include the same torture tests in validate CSV before emailing.
Error handling in merge loops
Classic merge aborts on first bad row or skips silently—behavior varies. CSV Sender validates before enqueue and tracks per-row outcomes. When evaluating merge tooling, ask how partial failures surface.
HTML sanitization
Merge HTML may include inline styles blocked by some clients. Prepared plain text avoids CSS surprises but limits branding. Decide brand requirements before picking merge vs prepared pipelines (mail merge vs prewritten emails).
Handoff documentation template
Document merge field names, data column names, render environment, and QA owner in a one-page runbook. Prepared CSV handoffs instead document CSV column contract and validation tool version. Both reduce midnight launch mistakes.
Summary for architects
Mail merge is render-then-send; CSV Sender is send-what-you-upload. Keep that separation in integration diagrams when CRM, merge, and Gmail API appear on the same slide.
Support escalation data
When merge fails in third-party tools, logs often cite template line numbers. When prepared CSV fails, logs cite CSV row validation. Teach support staff which artifact to inspect first.
Related articles
Mail Merge
What Is Mail Merge?
Define mail merge for email, how placeholder fields map to spreadsheet columns, and when finished CSV rows replace merge templates entirely.
Mail Merge
Gmail Mail Merge: Complete Guide
Orient Gmail and Google Workspace mail merge features using Google's documentation, and decide when prepared CSV rows plus Gmail API fit better.
Mail Merge
CSV Mail Merge: Complete Guide
Use CSV rows as mail-merge data sources for template tools—or skip merge entirely by uploading finished email, subject, and body columns to CSV Sender.
Gmail
Gmail API vs Mail Merge: Which Fits Prepared CSV Emails?
Compare Gmail API sending and classic mail merge for CSV-based outreach. Prepared subject and body columns vs templates and inbox plugins.
Permalink: http://localhost:3000/blog/how-email-mail-merge-works