Overview
Merge variables allow you to insert dynamic data into your mail pieces — such as names, promo codes, custom fields, or even personalized images. When your campaign runs, PostGrid replaces these placeholders with values from your mailing list, enabling fully customized communications for each recipient.
How to Use Merge Variables
Using merge variables involves two steps: adding the variable to your template and providing the matching data in your mailing list.
Text Merge Variables
Add a text element
In the Template Editor, drag a Text element onto your design.Insert default variables
PostGrid provides built-in variables for recipient and sender details (e.g., name, address).
Example:Hello, {{to.firstName}}Default recipient variables use the format
{{to.variableName}}; sender variables use{{from.variableName}}. You can find a list of all default merge variables values here.Insert custom variables
For anything not included in the default set — like promo codes or membership IDs — create your own variable:Your promo code is: {{code}}Important: The variable name (e.g.,
code) must match a column header in your mailing list CSV exactly, including case.Save your template
Click Save Template to apply the changes.
Image Merge Variables
Add an image variable
In the left sidebar, open Merge Variables and drag the Image element onto your template.Name your variable
With the image element selected, update the Merge Variable field (e.g.,itemImage).Prepare your mailing list
Add a column to your CSV using that exact name (itemImage). Each row must contain a publicly accessible image URL.Save your template
PostGrid will replace the placeholder with the image linked in each row of your list.
FAQ
Q: Can I use merge variables with PDF uploads?
A: Not directly. However, you can upload your PDF as an image in the Template Editor and overlay text elements containing merge variables.
Q: What happens if a variable is missing from my list?
A: Missing values typically render as blank fields. Test your template to confirm how empty data behaves in your workflow.
Q: Are custom merge variables case-sensitive?
A: Yes. The template variable and the CSV column header must match exactly.
Q: Where can I find the list of default merge variables?
A: In the PostGrid documentation under Creating Templates Using Template Editor → Acceptable Default Merge Variable Values for Contacts.
Q: What kind of URLs should I use for image variables?
A: Use publicly accessible URLs — PostGrid must be able to fetch the image during rendering.
