Liquid Markup lets a single email show different content to different recipients based on their entry. It's especially useful for Instant Win campaigns—where you want winners and non-winners to read different messages—and for showing a different email body depending on which prize someone won. Liquid is a templating language created by Shopify and used widely across ShortStack. This guide will walk you through how Liquid works in emails, the merge fields available to you, and ready-to-use markup you can copy and paste into your email content.
For instructions on creating the emails themselves, check out our other email help docs:
How Liquid Markup Works
Every example in this guide is built from three pieces. Once you recognize them, the rest reads like plain English.
-
Output —
{{ }}— Prints a value into the email, such as a name or a prize code. Example:{{ entry.first_name }}. -
Logic (tags) —
{% %}— Makes a decision, such as showing one message if someone won and another if they didn't. Example:{% if entry.instant_winner %}. -
Filters —
|— Reshapes a value before it displays, such as capitalizing a name or formatting a date. Example:{{ entry.first_name | capitalize }}.
Note: Logic always uses
{% %}and output always uses{{ }}. Don't place anifstatement inside double curly braces, and don't wrap a merge field in{% %}.
How to Add Liquid Markup in Your Email
You'll add Liquid Markup directly in the email content during the customization step of the Email Builder.
- Begin creating an email as described in the Autoresponder, Follow-Up, or Scheduled email help docs.
- Continue to the Customize Your Email step to open the Email Designer.
- Click into a text box and type or paste your Liquid Markup. You can also insert merge fields using the buttons in the Available Merge Fields section.
- To insert a prize code, place your cursor where you want it to appear and click the Prize Code button, or type
{{ entry.prize_codes }}manually. - Finish customizing, then click Continue.
- Activate your email.
Note: To use the Instant Win merge field, Instant Win must be enabled on your campaign, and this email must be connected to the same list as your form. Learn more in the Instant Win help doc.
Testing Your Email
To test your email, you will need to activate the email and publish your campaign.
- Testing Liquid Markup in Emails can only be done on the published landing page or embed.
- To force a win result:
- Open the Instant Win Advanced settings.
- Use the Prize Distribution Strategy drop-down and select All at the start.
- Save and Exit and Publish Changes.
- Enter the form on the published campaign with a valid email to receive the test email.
Common Liquid Markup Solutions for Emails
Copy any snippet below into your email content and replace the sample wording with your own.
Showing Different Content to Winners and Non-Winners
Use this when you want winners and non-winners to read different messages in the same email.
{% if entry.instant_winner %}
Congratulations — you won!
{% else %}
Thanks for playing! No win this time.
{% endif %}Content between {% if %} and {% else %} shows to winners. Content after {% else %} shows to everyone who didn't win. Always close the statement with {% endif %}.
Adding a Message for Everyone
Use this when the win/lose message differs but the closing line is the same for all recipients.
{% if entry.instant_winner %}
You're a winner!
{% else %}
Better luck next time.
{% endif %}
Thanks for entering {{ entry.tab_name }}.Anything placed after {% endif %} is outside the decision, so it always appears.
Showing a Prize Code to Winners Only
Use this when only winners should see a code and non-winners should see nothing extra.
{% if entry.instant_winner %}
Your prize code: {{ entry.prize_codes }}
{% endif %}No {% else %} is needed—non-winners simply see nothing in this block.
Showing a Different Message for Each Prize
Use this when prizes vary by tier or type. Store a readable prize name in your code list so that {{ entry.prize_codes }} holds a value you can test against.
{% if entry.prize_codes contains "GOLD" %}
You won the Grand Prize! Details inside.
{% elsif entry.prize_codes contains "SILVER" %}
Second place — nicely done!
{% else %}
You won a prize! Your code: {{ entry.prize_codes }}
{% endif %}The contains keyword checks whether the prize code includes that text. Add as many {% elsif %} branches as you have prize types.
Note: Code Lists are available on Scale Plan and higher. Text matching is case-sensitive, so keep the values in your code list consistent (
GOLDwill not matchgold).
Matching an Exact Prize
Use this when each prize is a single, tidy value—it's easier to read than a long stack of {% elsif %} statements.
{% case entry.prize_codes %}
{% when "FREESHIP" %}
Enjoy free shipping on your next order.
{% when "10OFF" %}
Here's 10% off — applied at checkout.
{% else %}
Your reward: {{ entry.prize_codes }}
{% endcase %}A {% case %} statement matches the prize value exactly against each {% when %}. The {% else %} catches anything not listed. Close the statement with {% endcase %}.
Combining a Win Check With a Prize Type
Use this when you first need to confirm a win, then tailor the message by prize.
{% if entry.instant_winner %}
{% if entry.prize_codes contains "TRIP" %}
Grand prize — you're going on a trip!
{% else %}
You won: {{ entry.prize_codes }}
{% endif %}
{% else %}
Thanks for playing — no win this time.
{% endif %}This is called nesting—one {% if %} placed inside another. Each opening tag needs its own {% endif %}.
Showing Content Based on a Form Answer
Use this when entrants chose from a dropdown or option list and each answer deserves different copy. Replace favorite_store with your own field name.
{% if entry.favorite_store == "Downtown" %}
Your nearest location is our Downtown shop.
{% elsif entry.favorite_store == "Airport" %}
Your nearest location is our Airport kiosk.
{% endif %}The == operator means "is exactly equal to." The text in quotes must match the form answer exactly.
Showing a Block Only If a Field Was Filled In
Use this when an optional field shouldn't leave an empty sentence when it's blank.
{% if entry.phone %}
We'll text order updates to {{ entry.phone }}.
{% endif %}An {% if %} with just a field name is true whenever that field has a value, so the block only appears when there's something to show.
Combining Two Conditions
Use this when content should appear only for recipients who meet two criteria at once.
{% if entry.instant_winner and entry.newsletter == "Yes" %}
As a winner who's opted in, here's an exclusive offer.
{% endif %}The and operator requires both conditions to be true. Use or instead if either one should be enough.
Filter Reference
Add any of these to a merge field with a | pipe. You can chain more than one—they run left to right.
-
| default: "there"— Falls back to your text when the value is empty. -
| capitalize— First letter uppercase, the rest lowercase. -
| upcase— Makes everything uppercase. -
| downcase— Makes everything lowercase. -
| date: "%B %d, %Y"— Formats a date. -
| truncate: 50— Shortens long text to 50 characters and adds an ellipsis. -
| strip— Removes stray spaces before and after a value. -
| append: "!"— Adds text to the end of a value (useprependto add to the start).
Tips and Troubleshooting
-
Match every opening tag with a closing one.
{% if %}needs{% endif %},{% case %}needs{% endcase %}, and{% unless %}needs{% endunless %}. A missing closing tag will break the email. - Insert field names from the Available Merge Fields section. Typing a field name by hand risks a small spelling difference that produces a blank. The buttons guarantee the exact name your form uses.
-
Text comparisons are exact and case-sensitive.
"Yes"will not match"yes", andcontains "Gold"will not match"GOLD". Keep your values consistent. - The Instant Win merge field requires Instant Win to be enabled. Turn it on for the campaign and connect this email to the same list as your form, or the win/lose logic will have nothing to read.
- Always send a test before activating. Use Send Test Email to confirm that winners, non-winners, and each prize type display correctly.