Liquid Variables Cheatsheet - ReferralCandy/candy_liquid GitHub Wiki


Templates

1. Advocate Join & Share

referral_email

Referral Emails are sent to advocates to invite them to join your referral program. They encourage advocates to share your product with their friends.

Liquid Objects
advocate, campaign, offer, referral_link, reward_setup

reminder_email

Reminder Emails are sent to advocates at fixed intervals to keep them updated on the latest offerings of your referral program. They also encourage them to share your product with their friends.

Liquid Objects
advocate, campaign, offer, referral_link, reward_setup

access_page

The Portal Access Page explains what your referral program is about, and invites advocates to fill in their details to join your referral program.

Liquid Objects
campaign, offer_setup, reward_setup

Registration Form

{% form 'registration_form' %}
  ...
{% endform %}

sharing_page

The Portal Sharing Page encourages advocates to share your product with their friends.

Liquid Objects
advocate, campaign, referral_link, offer, reward_setup

2. Friend Purchase

friend_landing_page

The Friend Offer Landing Page is shown to an advocate's friend when they click on the advocate's referral link. It displays a Friend Offer coupon code that can be used at your store, and encourages the friend to start shopping.

Liquid Objects
campaign, offer, referral_link

3. Advocate Reward Notification

reward_pending_email

The Pending Reward Email is sent to an advocate the moment ReferralCandy detects that a purchase is made through the advocate's referral link.

Liquid Objects
advocate, campaign

reward_successful_email

The Successful Reward Email is sent to an advocate when a referral they've made becomes eligible for a reward.

Liquid Objects
advocate, campaign, reward

reward_ineligible_email

The Ineligible Reward Email is sent to an advocate when a referral they've made (that was pending review) is cancelled, or when the associated purchase was returned.

Liquid Objects
advocate, campaign

4. Advocate Reward Tracking

private_signup_page

The Private Portal Create Password Page instructs advocates to create a password to gain access to their Private Portal Rewards Page.

Liquid Objects
advocate, campaign

Set Password Form

{% form 'set_password_form' %}
  ...
{% endform %}

private_sigin_page

The Private Portal Log-in Page is where advocates login to their Private Portal Rewards Page with the password they've created.

Liquid Objects
advocate, campaign

Signin Form

{% form 'signin_form' %}
  ...
{% endform %}

rewards_page

The Private Portal Rewards Page is where advocates configure their rewards settings, and view their referral activity history, as well as earned rewards.

Liquid Objects
advocate, campaign, pending_referred_purchases, rewards, reward_setup

Cash Rewards Option Form

{% form 'cash_rewards_option_form', advocate.portal %}
  ...
{% endform %}

Messaging Settings & Post Purchase Widget

messaging_preferences_page

The Portal Messaging Preferences Page is where advocates configure their preference for the frequency in which they receive emails sent on your behalf by ReferralCandy.

Liquid Objects
advocate, campaign

Messaging Preferences Form

{% form 'messaging_preferences_form', advocate.portal %}
  ...
{% endform %}

post_purchase_widget

The Post Purchase Widget shows up right after each advocate’s purchase, to encourage them to share your product with their friends.

Liquid Objects
advocate, campaign, referral_link, offer, reward_setup

Liquid Variables

Layout Variables

These 3 liquid variables MUST be included in layout file i.e. layouts/page.liquid or layouts/embed.liquid:

  1. {{ content_for_header }} - Place it between the opening and closing <head> tag. It inserts the necessary scripts for analytics and referral tracking purpose.
  2. {{ content_for_layout }} - Place it between the opening and closing <body> tag. It renders the page content.
  3. {{ content_for_footer }} - Place it right before the closing </body> tag. It inserts necessary scripts for analytics and tracking purchase.

Global Variables

These liquid variables can be used in all templates:

  • {{ template }} - The current template code name
  • {{ locale }} - ISO 639-1 language code e.g. 'en', 'zh-TW'
  • {{ is_embed }} - true if the page is rendered as embedded, otherwise false
  • {{ hide_offer }} - true if the page should be Friend Offer coupon code (when an advocate attempts to click on their own referral link), otherwise false
  • {{ flash }} - contains errors or informational messages to be shown on a page
  • {{ now }} - returns the current time when template is rendered

Liquid Objects

These are all the liquid objects supported by ReferralCandy. Some liquid objects can only be used in certain templates.

Liquid Object
advocate
campaign
offer
offer_setup
pending_referred_purchases
purchase
referral_link
reward
reward_setup
rewards

advocate

A customer who has been enrolled in your referral campaign.

  • {{ advocate.first_name }} - An advocate's first name
  • {{ advocate.last_name }} - An advocate's last name
  • {{ advocate.email }} - An advocate's email address
  • {{ advocate.portal }} - Information about an advocate's ReferralCandy Portal (see advocate.portal)
  • {{ advocate.cash_reward_settings }} - Cash reward payout options set by an advocate

advocate.cash_reward_settings

  • {{ advocate.cash_reward_settings.payout_option }} - Cash payout option that is selected by an advocate
    • Valid values - 'paypal', 'paypal_gift', 'donation'
  • {{ advocate.cash_reward_settings.paypal_email }} - An advocate's PayPal email address. This variable is available when payout option is set to 'paypal'
  • {{ advocate.cash_reward_settigns.donation_charity_option }} - Donation charity selected by an advocate

advocate.portal

Information about an advocate's ReferralCandy Portal

  • {{ advocate.portal.code }} - An advocate's Portal Code
  • {{ advocate.portal.sharing_page_url }} - An advocate's Sharing Page URL
  • {{ advocate.portal.rewards_page_autologin_url }} - Portal Rewards Page Auto-Login URL. This link allows your advocate to access their Rewards Page without login credentials
  • {{ advocate.portal.rewards_page_url }} - Rewards Page URL
  • {{ advocate.portal.messaging_preferences_page_url }} - Messaging Preferences Page URL
  • {{ advocate.portal.unsubscribe_url }} - Unsubscribe URL
  • {{ advocate.portal.contact_interval }} - The interval of receiving referral/reminder emails (in days) that an advocate has selected. For example,
    • 5 means an advocate receives emails every 5 days
    • 0 means an advocate always receives emails based on campaign settings
    • 36525 means an advocate will never receive emails
  • {{ advocate.portal.contact_interval_mapping_for_select }} - The available email sending interval options in the Messaging Preferences Page

campaign

Information about the referral campaign

  • {{ campaign.shop_url }} - the retailer's shop URL
  • {{ campaign.shop_name }} - the name of the shop
  • {{ campaign.shop_logo_url }} - the uploaded shop logo image URL

offer

Information about the Friend Offer

  • {{ offer.description }} - Friend Offer description
  • {{ offer.code }} - the Friend Offer coupon code
  • {{ offer.expiry_date }} - Expiry date of the Friend Offer
  • {{ offer.type }} - Type of offer
    • Valid values - 'coupon', 'custom', 'none'

offer_setup

Friend Offer settings of the referral campaign

  • {{ offer_setup.description }} - Friend Offer description

pending_referred_purchases

Referred purchases of an advocate that count towards rewards, but are still within the review period.

You can use {% for purchase in pending_referred_purchases %} to access each pending referred purchase. See purchase for a list of purchase information that you can use.

purchase

Purchase made by a customer in your store.

  • {{ purchase.review_deadline }} - The review period deadline for the purchase
  • {{ purchase.date_purchased }} - The date the purchase was made

referral_link

A unique link given to each advocate when they are enrolled in your referral program. When a advocate's friend clicks on their referral link, the friend will be brought to a landing page, which shows them the coupon code (Friend Offer) that can be used at your store.

  • {{ referral_link.url }} - The referral link URL
  • {{ referral_link.redirect_to_shop }} - "Take Me to Store" link URL
  • {{ referral_link.share_via_email }} - "Share via Email" link URL
  • {{ referral_link.share_via_facebook }} - "Share via Facebook" link URL
  • {{ referral_link.share_via_twitter }} - "Share via Twitter" link URL

reward

A Referral Reward earned by an advocate.

  • {{ reward.status }} - Referral Reward fulfilment status
    • Valid values:
      • 'unable_to_deliver' - Usually used when an advocate hasn't selected their preferred cash reward payout option.
      • 'pending_fulfilment' - The reward is awaiting preparation by the retailer or system
      • 'shipped' - The reward has been sent out to an advocate
      • 'delivered' - The reward has been received by the advocate
  • {{ reward.description }} - Referral Reward description
  • {{ reward.coupon_expiry_date }} - The reward coupon's expiry date
  • {{ reward.coupon_code }} - The reward coupon code
  • {{ reward.type }} - The type of reward
    • Valid values - 'coupon', 'cash', 'custom'
  • {{ reward.date_earned }} - The timestamp when reward is earned
  • {{ reward.date_shipped }} - The timestamp when reward is sent out to advocate
  • {{ reward.date_delivered }} - The timestamp when reward is received/claimed by advocate

reward_setup

Referral Reward settings of the referral campaign

  • {{ reward_setup.description }} - Referral Reward description
  • {{ reward_setup.type }} - The selected type of reward
    • Valid values - 'coupon', 'cash', 'custom'
  • {{ reward_setup.cash_reward_payout_options }} - Available cash payout options
  • {{ reward_setup.donation_charity_options }} - Available donation charity options

rewards

Referral Rewards earned by an advocate.

You can use {% for reward in rewards %} to access each earned reward. See reward for a list of reward information that you can use.


Filters & Tags

You can use all standard filters and standard tags listed in the Liquid for Designers documentation.

In addition, ReferralCandy provides a few additional filters and tags for your use:

Filters

  • candy_image_url - Returns the URL of ReferralCandy-hosted images e.g. {{ 'icons/censored.png' | candy_image_url }}
  • t - Returns the translated string stored in "locales" folder based on the specified translation key e.g. {{ "page.access_page.registration_form_header" | t }}

Tags

  • form - Returns the <form> tag, see the specific template for details about the form tag usage within the template.
⚠️ **GitHub.com Fallback** ⚠️