Variable Mapping
Variable mapping connects spreadsheet column values to placeholders in your email body, subject line, and document template. The mapping interface appears when you create or configure a campaign.
The Mapping Interface
The left panel lists all placeholders detected in your template (e.g. {{full_name}}, {{course_title}}).
The right panel lists all normalized columns from the selected dataset.
Drag a column onto a placeholder (or use the dropdown) to create a mapping.
MergeMail auto-maps placeholders where the placeholder name exactly matches a column name.
For example, if your spreadsheet has a column full_name and your template has {{full_name}},
the mapping is applied automatically. You only need to manually map the mismatches.
Mapping Scope
- Email subject: Placeholders in the subject line are resolved from the same mapping.
- Email body: Both HTML and plain-text bodies support
{{placeholders}}. - Document template: Mapped separately in the template editor. Mappings made in the campaign wizard apply to the email body; document mappings are saved with the template.
Formatters
Formatters are appended to a placeholder name with a pipe character (|) and modify the output value at substitution time.
Formatters do not change the data in your spreadsheet.
| Formatter | Description | Input → Output |
|---|---|---|
| |upper | Convert the value to uppercase | adaeze → ADAEZE |
| |lower | Convert the value to lowercase | ADAEZE → adaeze |
| |title | Convert to Title Case (capitalize first letter of each word) | adaeze okonkwo → Adaeze Okonkwo |
| |default:fallback | Use fallback string if the cell is empty or null | (empty) → N/A |
| |trim | Remove leading and trailing whitespace | hello → hello |
Formatter Examples
Subject: Certificate for {{full_name|title}}
Dear {{full_name|title}},
Your course "{{course_title|upper}}" has been completed.
Thank you, {{first_name|default:Participant}}! For a spreadsheet row where full_name = "adaeze okonkwo" and course_title = "data analysis":
Subject: Certificate for Adaeze Okonkwo
Dear Adaeze Okonkwo,
Your course "DATA ANALYSIS" has been completed.
Thank you, Adaeze! Chaining Formatters
Formatters cannot currently be chained. Only one formatter per placeholder is supported.
Missing Mappings
If a placeholder in the template has no mapping (no spreadsheet column assigned), the placeholder text is left as-is in the output.
For example, an unmapped {{certificate_id}} will appear literally as {{certificate_id}} in every generated document.
MergeMail warns you about unmapped placeholders before you launch the campaign.
Empty Cell Handling
If a mapped column has an empty value for a particular row, the placeholder resolves to an empty string unless a |default formatter is applied.
Use {{field|default:N/A}} to display a fallback value instead of a blank.