List rewards
List of all the variables available in Liquid to display information about the loyalty rewards.
List rewards granted to a contact
How to display all the rewards that have been granted to a contact. A reward that has been granted to a contact is often referenced as a "reward attribution" inside Splio.
In Liquid you'll have direct access to this list via the variable granted_rewards
inside a loop.
Example
This is a list of all rewards you own :
{% for granted in granted_rewards | sort: "external_id" %}
{% if granted.status == "valid" %}
You own the reward {{ granted.name }}, it gives you access to {{ granted.description }}!
{% if granted.monetary %}
The reward has a value of {{ granted.monetary_value }} €
{% endif %}
You must use it before the {{ granted.expiration_date | date: '%Y-%m-%d' }}
To use it redeem the code: {{ granted.external_id }}
{% endif %}
{% endfor %}
List of available variables
Inside the loop you'll have access to theses variables.
Liquid variable | Description |
---|---|
{{ granted.external_id }} | External ID of the reward attribution, the unique code to redeem in order to used the attribution |
{{ granted.card_code }} | Card code of the loyalty member who has received the reward attribution |
{{ granted.burned_date }} | Date on which the reward attribution has been burned/used ("0000-00-00 00:00:00" if not used yet) |
{{ granted.earned_date }} | Date on which the reward attribution has been/will be granted |
{{granted.expiration_date}} | Date on which the reward attribution will/has expired |
{{ granted.status }} | Status of the reward. It gives information on if the reward has been used yet or has expired. It can be one of theses values : "valid", "expired", "burned", "pending" |
{{ granted.name }} | Name of the master reward |
{{ granted.description }} | Description of the master reward |
{{ granted.monetary }} | Boolean (true/false) to know if the master reward has a monetary value |
{{ granted.monetary_type }} | Monetary type of the master reward. It can be one of theses values: "precentage", "value" |
{{granted.monetary_value}} | Monetary value of the master reward |
{{ granted.image_url }} | Image URL of the master reward |
{{ granted.nqp_value }} | Cost in non-qualifying points of the reward |
{{ granted.holding_days }} | Holding period of the master reward |
{{ granted.store_id }} | The internal Splio ID of the store the reward attributed was granted in. |
{{granted.master.external_id}} | The external ID of the master reward |
Special use case: sending an email after a "Grant a reward" action in a Campaign
When you grant a reward to a contact inside a campaign, if you send an email in the following action. The liquid variable reward
is automatically filled with the reward attribution that was given to the contact.
Which means:
- It's directly accessible you don't have to be in a
granted_rewards
loop to access it - You have access to all the variables in the above list when designing your email, the prefix you have to use is
reward.
instead ofgranted.
. For example :{{ reward.external_id }}
or{{ reward.name }}
List all rewards of the universe
How to display a list of all the master reward defined in the universe.
In Liquid you'll have direct access to this list via the variable rewards
inside a loop
Example
{% for master in rewards %}
Here's a reward that might be interesting: {{ master.name }}. With it you can {{ master.description }}. This reward costs {{ master.nqp_value }} points!
{% if master.forced_validity %}
This reward is only available between {{ master.forced_validity_start }} and {{ master.forced_validity_end }}
{% else %}
In order to use it you'll have to wait {{ master.holding_days }} days after earning it!
After this time the reward will be available to use for {{ master.validity_interval_count }} {{ master.validity_interval_type }}.
{% endif %}
{% if master.monetary %}
This reward is worth {{ master.monetary_value }} €!
{% endif %}
{%if master.limited %}
There's only {{ master.stock }} left of this reward!
{% endif %}
{% endfor %}
List of available variables
Inside the loop you'll have access to theses variables
Liquid variable | Description |
---|---|
{{ master.external_id }} | External ID of the master reward |
{{ master.name }} | Name of the master reward |
{{ master.description }} | Description of the master reward |
{{ master.image_url }} | Image URL of the master reward |
{{ master.monetary }} | Boolean (true/false) to know if the master reward has a monetary value |
{{ master.monetary_type }} | Monetary type of the master reward. It can be one of theses values: "precentage", "value" |
{{ master.monetary_value }} | Monetary value of the master reward |
{{ master.nqp_value }} | Cost in non-qualifying points of the reward |
{{ master.limited }} | Boolean (true/false) to know if the master reward is unlimited or limited |
{{ master.stock }} | The number of codes left for attribution in this reward (only if it's limited, if unlimited it will be 0) |
{{ master.holding_days }} | Number of days you have to wait before being able to burn the attribution of the reward |
{{ master.forced_validity }} | Boolean (true/false) to know if the master reward has a forced validity (can only be used between two specific dates) |
{{ master.forced_validity_start }} | Start of the specific date range to use the reward (only if reward has forced_validity) |
{{ master.forced_validity_end }} | End of the specific date range to use the reward (only if reward has forced_validity) |
{{ master.validity_interval_type }} | Duration used to calculate the validity of a reward attribution after it was earned (e.g. "days", "weeks", "months", "years") |
{{ master.validity_interval_count }} | Number used to calculate the validity of a reward attribution after it was earned. It will be valid for validity_interval_count * validity_interval_type (e.g. "7 days", "8 months"...) |
{{master.custom_fields['your_field_name']}} | Access the value of a specific custom fields of the master reward by replacing your_field_name by the actual name of the custom field. |
Updated 20 days ago