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 add these yourself. Every ReferralCandy email and page already includes the right variables in its default content. In the Theme editor, open an email or page and click a text block to see the variables it uses — for example, a Welcome email heading reads Hey {{ advocate.first_name | capitalize }}, ... — then reuse those variables in your own copy.
How a Liquid variable works
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 the variables merchants use most. Each one only works in certain templates — the default content already inside a template is the definitive list of what's available there.
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) show up in advocate-facing emails and pages, while your store and campaign details are available more widely. To see exactly what a single template supports, open it in the Theme editor — its default content lists every variable available there.
Article FAQ
Why is my variable showing as blank or as plain text?
Why is my variable showing as blank or as plain text?
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 a variable doesn't appear at all, it may not be available in that template — check the template's default content in the Theme editor.
