Liquid is an open-source templating language created by Shopify. ReferralCandy uses it to insert dynamic content — like an advocate's name, the friend offer, or the reward they've earned — into your campaign emails and pages. It works the same way for every ReferralCandy merchant, whatever platform your store runs on.
You usually don't need to type Liquid yourself. In the block email editor, click a text block, place the cursor where you want a value, then choose Insert a variable. Select from the named variables offered for that email. Existing variables appear as chips in the text; their preview values are examples. In templates using the previous editor, you can reuse the variables in the default content.
How a Liquid variable works
The code examples below are for templates edited as Liquid, including pages and the previous email editor. For block emails, insert named variables from the picker and preview their values rather than pasting these code examples into the text.
Wrap a variable in double curly braces and ReferralCandy swaps in the real value when the email or page is shown. For example, Hey {{ advocate.first_name }}! becomes Hey Amy!
Filters adjust a value using
|— for example,{{ advocate.first_name | capitalize }}capitalizes the name.Spelling has to be exact — a missing brace or letter (such as
{ advocate.first_name }or{{ advocate.first_nam }}) stops the variable from working.
Common variables
These are common variables for Liquid templates. Availability depends on the template. In block emails, use Insert a variable instead of assuming these code names are available; in the previous editor, start with variables already used in its default content.
About the advocate
{{ advocate.first_name }}— the advocate's first name (advocate.last_nameandadvocate.emailwork too){{ referral_link.url }}— the advocate's unique referral link
About the offer and reward
{{ offer.description }}— the friend offer (for example, "25% off"){{ offer.code }}— the friend offer's coupon code{{ reward.description }}— the reward the advocate earned{{ reward.coupon_code }}— the reward's coupon code (when the reward is a coupon)
About your store
{{ campaign.shop_name }}— your store's name{{ campaign.shop_url }}— your store's web address
Templates can include more advanced variables too — for example, tiered-reward details. They work the same way; open the template in the editor to see exactly which variables it uses.
Where Liquid variables work
Liquid variables only work inside ReferralCandy's own emails and pages — not your store platform's native emails (for example, Shopify's order-confirmation email).
Within ReferralCandy, each variable appears where it makes sense: details about the advocate (their name, referral link, offer and reward) belong in the relevant advocate-facing templates, while store and campaign details are available more widely. Check the block email's variable picker or the template's existing variables rather than assuming a variable works everywhere.
Article FAQ
Why is my variable showing as blank or as plain text?
Why is my variable showing as blank or as plain text?
For a template edited as Liquid, there are two common reasons:
It shows as plain text (you literally see
{{ advocate.first_name }}in the email) — the variable is misspelled or missing a brace. Make sure it's wrapped in{{ }}and spelled exactly.It shows as blank — the variable has no value in that case. For example,
{{ offer.description }}is empty when the friend offer is set to None, and reward variables stay empty until a reward is earned.
If the value is unavailable, check whether the variable is supported by that template and whether it has data in the scenario you are previewing. In block emails, insert the named variable from the picker and check the preview for the value you expect.
