Merge Tags
Utilize HTML Merge Tags to pull variable audience data into creative designs and beyond.
Poplar offers a variety of flexible and creative ways to customize mailers based on multiple types of collected Audience data. These personalizations can be broken down into three merge tag categories: Default, Location Based, and Custom - all of which can be dynamically optimized by the use of Shopify’s Liquid Template language. All merge tag names must be formatted to exactly match the corresponding column header in your Mail File or Mailing API request.
Example of how to match Mail File column headers to Merge Tag values

Default Merge Tags

Poplar will automatically populate default merge tags based on recipient data received via CSV upload or trigger integration. In your HTML creative, default merge tags are always preceded by recipient. to access the core recipient data in your mail file or API request.
The platform will NOT prompt you to set default values for default merge tags. This means that in the event of a blank value or mismatched data, your creative will print with a blank. Double check all column headers and Test all triggers before launch to ensure there are no merge tag data discrepancies.
Missing first name data will populate as Current Resident and will appear on your creative as such - if you are using the {{recipient.first_name}} merge tag, make sure first name is provided for every recipient. See the Custom Merge Tag section for details on how to use first name with a default value...
Column Header or Field
Merge Tag
full_name
{{recipient.full_name}}
first_name
{{recipient.first_name}}
last_name
{{recipient.last_name}}
address_1
{{recipient.address_1}}
address_2
{{recipient.address_2}}
city
{{recipient.city}}
state
{{recipient.state}} or {{recipient.state_name}}
postal_code
{{recipient.postal_code}}
email
{{recipient.email}}
identifier
{{recipient.identifier}}

Location Based Merge Tags

Location based merge tags populate with data pulled from Saved Locations within your Poplar account. They are considered default merge tags, meaning the platform will NOT prompt you to set a default value to appear in the event of missing data. Location based merge tags provide a flexible and easy way to customize creative based on Geolocation settings.
Saved Location Field
Merge Tag
Location Name
{{location.name}}
Address 1
{{location.address_1}}
Address 2
{{location.address_2}}
City
{{location.city}}
State
{{location.state}} or {{location.state_name}}
Postal Code
{{location.postal_code}}
Merge field 1
{{location.merge_field_1}}
Merge field 2
{{location.merge_field_2}}
Merge field 3
{{location.merge_field_3}}

Custom Merge Tags

Poplar populates custom merge tag data by pulling from any additional column headers in your CSV Mail File, or any values present in the merge_tags object of your triggered API request. When HTML creative files are uploaded, the platform will scan for any custom merge tags present in your design and prompt you to set a default value. The default value will populate the custom merge tag in the event of a blank field or mismatched data in your CSV mail file or API request.
Uploading and storing files under Audiences will strip all custom merge tag values and extra column headers. To preserve custom merge tags for a One Time Send, drag & drop your CSV file directly into the platform during the launch process.
When adding custom merge tags to you HTML, make sure they are always preceded by custom. This is how the platform differentiates between default and custom merge tags. The following are common examples of custom merge tags:
Column Header or Field
Merge Tag
promo-code
{{custom.promo-code}}
expiration-date
{{custom.expiration-date}}
sales-rep
{{custom.sales-rep}}
spend-amount
{{custom.spend-amount}}
loyalty-level
{{custom.loyalty-level}}
first-name
{{custom.first-name}}
If you don't have first name data for every recipient, you can create an additional custom merge tag named anything BUT first_name (ie. first-name or firstname). The platform will prompt you to set a default value (ie. "there" or "friend") to appear in the event of missing data.

Liquid Templates

Poplar accepts the use of Shopify's Liquid Template language in HTML creatives. Liquid is an open-source templating language that lets you add nifty logic to dynamic data to make it even more flexible by using:
Objects Add high-level variability to dynamic data in your creative. All default and custom merge tags used in creative are classified as objects.
Tags Let you add conditional logic (using operators) to your messages. The most basic form is an if...else statement.
Filters Allow you to reformat and set consistent formatting (ie uppercase, lowercase, or proper-case) merge tag values.

Examples & Use Cases

There's no limit on the number of ways you can get creative with Liquid Templates; below are some sample use cases and code snippets to get you started. We highly recommend testing all your Liquid templates thoroughly in order to ensure they are error free!

Rolling Expiration Date

Add an expiration date to your creative that will always show 90 days from the time of print. The Liquid filter below creates a Unix timestamp, adds the number of seconds in 90 days and then reformats the date. See more date formats...
1
<!-- Example -->
2
If the postcard is printed on January 1, 2020 the output will automatically
3
calculate and show 90 days in the future.
4
5
<!-- Code -->
6
<div class="terms">
7
<p>
8
Offer valid before {{ "now" | date: "%s" | plus: 7776000 | date: "%b %e, %Y" }}.
9
Visit heypoplar.com/legal for additional terms.
10
</p>
11
</div>
12
13
<!-- Output -->
14
Offer valid before Mar 31, 2020.
15
Visit heypoplar.com/legal for additional terms.
Copied!

Consistent Character Casing

If your audience data contains some values that appear in all caps, lowercase, or a mix of both, Liquid can be used to ensure they appear consistently formatted in your creative design. Below is an example for how to make sure all first_name data appears in proper case, with the first letter uppercase and the rest lowercase.
1
<!-- Example -->
2
If audience data contains first_name "jane" or "JANE" you want to make sure it
3
always appears as "Jane"
4
5
<!-- Code -->
6
<div class="dynamic-greeting">
7
<p>
8
Hey {{ recipient.first_name | capitalize }}!
9
Check out our new summer styles...
10
</p>
11
</div>
12
13
<!-- Output -->
14
Hey Jane!
15
Check out our new summer styles...
Copied!

Variable Discount

Offer a variable discount based on a customer’s purchase history, average order value, loan-to-value, etc. The Liquid tag below will use a custom merge tag to display a different message based on the purchase_history value listed in your audience data.
1
<!-- Example -->
2
A value greater than or equal to $200 for purchase_history would should read:
3
"In celebration of your birthday, please take 20% off your next purchase..."
4
5
A value below $200 should read:
6
"In celebration of your special day, take $10 off your next purchase..."
7
8
<!-- Code -->
9
<div class="offer">
10
<h1>We want to say thank you for your loyalty -</h1>
11
<p>
12
{% if custom.purchase_history >= "200.00" %}
13
Enjoy 20% off your next purchase!
14
{% else %}
15
Here's $10 off your next purchase of $100 or more!
16
{% endif %}
17
</p>
18
</div>
19
20
<!-- Output for purchase_history >= $200 -->
21
We want to say thank you for your loyalty -
22
Enjoy 20% off your next purchase!
23
24
<!-- Output for purchase_history < $200 -->
25
We want to say thank you for your loyalty -
26
Here's $10 off your next purchase of $100 or more!
Copied!

Terms & Conditions

Dynamically alter legal text based on the recipient's city or state.
1
<!-- Example -->
2
Adjusting the legal text only on mailers sent to California to be CCPA
3
compliant
4
5
<!-- Code -->
6
<div class="legal">
7
<p>
8
Offer valid for first purchase.
9
{% if recipient.state == “CA” or recipient.state == "California" %}
10
Under the California Consumer Privacy Act (CCPA)...
11
{% else %}
12
Read our privacy policy at heypoplar.com/legal.
13
{% endif %}
14
</p>
15
</div>
16
17
<!-- Output for California residents -->
18
Offer valid for first purchase. Under the California Consumer Privacy Act (CCPA)...
19
20
<!-- Output for everywhere else -->
21
Offer valid for first purchase. Read our privacy policy at heypoplar.com/legal.
Copied!

Behavior Dependent Images

Show a different product image based on characteristics related to the recipient’s most frequently purchased item. Below we have a custom merge tag called item-color, and the image shown in the creative features items of a similar color to those most frequently purchased.
1
<!-- Example -->
2
If a customer frequently buys red sunglasses, we want to show an image containing
3
mostly red sunglasses.
4
5
If a customer frequently buys blue sunglasses, we want to show an image containing
6
mostly blue sunglasses
7
8
<!-- Code -->
9
<img
10
{% if custom.item-color == "red" %}
11
src="https://amazons3.com/my_images/red_sunglasses.png"
12
{% elsif custom.item-color == "blue" %}
13
src="https://amazons3.com/my_images/blue_sunglasses.png"
14
{% else %}
15
src="https://amazons3.com/my_images/mixed_sunglasses.png"
16
{% endif %}
17
>
18
19
<!-- Output for Red -->
20
<img src="https://amazons3.com/my_images/red_sunglasses.png" class="dynamic-img">
21
22
<!-- Output for Blue -->
23
<img src="https://amazons3.com/my_images/blue_sunglasses.png" class="dynamic-img">
24
25
<!-- Output for N/A -->
26
<img src="https://amazons3.com/my_images/mixed_sunglasses.png" class="dynamic-img">
Copied!
Reach out to [email protected] for more use cases or assistance...