Tools Viewer

How to Preview Email Merge Tags With Sample Data

Published on July 26, 2026 by Tools Viewer

How to Preview Email Merge Tags With Sample Data
How to Preview Email Merge Tags With Sample Data

Transactional and personalized emails use merge tags —{{first_name}},{{order_total}},{{items}}— to insert subscriber data at send time. Previewing an email with unfilled placeholders shows you the template structure but not how it looks with real data. WithEmail Viewer, you can apply asample JSON payloadto fill your merge tags and preview the fully populated email — without connecting to an email platform or sending a test message.

What are email merge tags?

Merge tags (also called merge tags or template variables) are placeholders in your email HTML that get replaced with subscriber data when the email is sent. The exact syntax varies by email platform:

  • Mailchimp:*|FIRST_NAME|*
  • Klaviyo / Liquid:{{ first_name }}
  • Mustache:{{first_name}}
  • Handlebars:{{contact.firstName}}

Email Viewer's sample payload feature uses Mustache-style{{variable}}syntax for the preview. Your templates should use this format when working in Email Viewer — you can still convert to your email platform's specific syntax before exporting.

Why preview with a sample payload?

Previewing a template with empty placeholders like{{first_name}}visible tells you the structure works, but it does not tell you:

  • Whether a long product name overflows a fixed-width cell
  • Whether a list of items (an order confirmation's line items) shows correctly with three items, or with zero items
  • Whether the conditional sections (show a "thank you for your purchase" block only if the order type is a purchase) display as expected
  • How the email looks with a real person's name and address in it, giving you a sense of the final user experience

A sample payload fills in all the blanks so you can review the email as a recipient would see it.

Supported merge tag syntax

Email Viewer supports Mustache-style merge tags including array loops:

  • Simple variable:{{first_name}}— replaced with the value offirst_namefrom the payload JSON
  • Nested object:{{address.city}}— replaced with the nested value
  • Array loop:{{#items}}...{{/items}}— repeats the block for each item in the array
  • Loop field access:Inside a loop, use{{name}},{{price}}, etc. to access fields on the current item
  • Conditional blocks:{{#condition}}...{{/condition}}— shows the block only if the value is truthy

How to apply a sample payload in Email Viewer

  1. OpenEmail Viewer on ToolsViewer.
  2. Load a template that uses merge tag placeholders — a Dynamic or Premium template from the gallery, or paste your own template HTML with{{variable}}placeholders.
  3. ClickPayloadin the toolbar. The payload panel opens showing either a blank JSON editor or the bundled sample data for gallery templates.
  4. Review the bundledtemplate sample dataif present. Gallery templates that use dynamic content send with representative sample data so you can see a fully populated example immediately.
  5. Edit the payload JSON to use your own values. Add more items to arrays, change names and product details, or modify conditional values to test different states.
  6. ClickApply payload. The preview updates to show the template with your sample data filled in.

Writing your own payload JSON

The payload is a standard JSON object. The keys match the variable names in your template tags. For example:

json
{
  "first_name": "Sarah",
  "order_id": "ORD-29847",
  "order_total": "$124.50",
  "items": [
    { "name": "Wireless Headphones", "price": "$89.99", "qty": 1 },
    { "name": "Phone Case", "price": "$14.99", "qty": 2 },
    { "name": "USB-C Cable", "price": "$19.99", "qty": 1 }
  ],
  "shipping_address": {
    "city": "Austin",
    "state": "TX"
  }
}

Your template would reference these as{{first_name}},{{order_id}}, loop with{{#items}}...{{/items}}, and access nested values as{{shipping_address.city}}.

When this feature is most useful

  • Proofing personalization before connecting an email platform.Check that your merge tag syntax is correct and that the populated email looks right before you configure the template in your sending platform.
  • Testing order confirmation layouts.Fill in a realistic set of line items — including edge cases like one item, many items, long product names — to check that the order table handles all cases correctly.
  • Verifying conditional content.Toggle conditional values in the payload (set a flag to true or false) to confirm that the right blocks appear and disappear.
  • Reviewing with a client or stakeholder.An email with real-looking data is much easier for a non-technical reviewer to evaluate than one full of{{placeholder}}text.