Skip to main content

Use variables in your loyalty emails

Add variables such as the customer's name, points or discount code to your Appstle Loyalty emails, and see which variables each email can use.

Variables are placeholders that Appstle Loyalty fills in with each customer's own details when it sends an email, such as their first name, points balance or discount code. You write them in double curly brackets, for example {{customer.first_name}}.

This article shows how to add a variable, where variables work, and which variables each email can use.


Add a variable to an email

  1. In the Appstle Loyalty app, click More, then click Email Templates.

  2. Click Edit next to the email you want to change.

  3. Click Content at the top of the email settings.

  4. Click in the Message box, where you want the variable to appear.

  5. Click Add Variable above the box, then pick a variable. You can search the list by name or description. The app adds the variable at your cursor.

  6. Check the result in the preview. It updates as you type; click Refresh to update it right away.

  7. Click Save in the bar at the top of the page.

This is the Add Variable list in the Point Earn email. Each variable has a short description under it.

The Add Variable list is different for each email: it shows only the variables that email can fill in. You can also type a variable yourself. Type it exactly as shown. Names are case-sensitive, so {{availablePoints}} works and {{availablepoints}} shows nothing. Spaces inside the brackets don't matter.

The preview shows example values, such as "John" for the first name. Each customer sees their own details in the real email. To see the email in your inbox, save your changes, then click Test Email at the top of the page. The test email also uses example values.


Where variables work

Variables are filled in only in some fields of the Content view. This table shows which ones.

Field

Variables

Subject

Only {{shop.name}}. Any other variable comes out empty.

Heading

Yes. Type the variable yourself.

Message

Yes. Use Add Variable.

Available Points Label

Yes, for example {{availablePoints}}. The label shows only when Show Available Points Label is on. In the Credits Earn email, these are Show Available Store Credits Label and Available Store Credits Label, and the balance is {{availableStoreCredits}}.

Claim Now Button Text

Yes.

Footer Text, Unsubscribe Text and Point Earn Button Text

No. They appear exactly as you type them.

If the Content view has no Heading field, your store uses the older email layout. In that layout, put greetings in the Message. Also leave {{availablePoints}} out of the Available Points Label, because the email adds the balance after the label by itself. To move to the newer layout, chat with us.


Variables for most emails

These variables work in every email except the two emails that go to a referred friend. Those have their own list further down.

Variable

What it shows

{{customer.first_name | default: 'there'}}

The customer's first name, or "there" when they have none.

{{customer.display_name}}

The customer's full name.

{{customer.last_name}}

The customer's last name.

{{availablePoints}}

The points balance when the email is sent.

{{availableStoreCredits}}

The store credit balance when the email is sent.

{{tierName}}

The customer's VIP tier. Empty when they have none.

{{pointExpireDate}}

The date the customer's points expire. Empty when points expiry is off.

{{shop.name}}

Your store name.

Dates show as year, month, day, for example 2026-11-27.


Variables for specific emails

Some emails add their own variables to the ones above. Use each one only in the emails named in its heading.

Welcome Email

The Welcome Email can show the customer's discount codes and their balance from before the sign-up points.

Variable

What it shows

{% for reward in customerRewards %}<p>{{reward.code}}</p>{% endfor %}

Each unused discount code the customer has when the email is sent.

{{availablePoints}}

The points balance before the sign-up points are added.

Reward Available Reminder, Discount Expiring Reminder and Birthday

These three emails are about one reward. They share these variables.

Variable

What it shows

{{rewardName}}

The reward's discount code, or what the customer got if it has none.

{{rewardDescription}}

What the reward gives, for example "$10 off".

{{rewardMinimumSpendAmount}}

The minimum order amount, for example $50, or $0 when there's none.

The Discount Expiring Reminder also has {{expireDate}}, the date the code expires. The email goes out 3 days before. It is sent for discount codes only, not for store credit rewards.

Points Expiring Reminder

This email warns the customer that points are about to be removed. It goes out the number of days before the removal that you set in Points Expiring Reminder (days before), in this email's Global view. When that is empty, it goes out 3 days before.

Variable

What it shows

{{expireDate}}

The date the points are removed.

Point Earn and Credits Earn

These two emails tell the customer what they earned.

Variable

What it shows

{{points}}

The points earned (Point Earn email only).

{{store_credit}}

The store credit earned (Credits Earn email only).

{{ruleName}}

What the customer earned for. Blank when several ways to earn apply.

{{rewardName}}

The message set on the way to earn, for sign-ups, social and review rewards, or the note on a manual award. Blank for purchases.

{% for activity in earnActivity %}<p>{{activity}}</p>{% endfor %}

Each thing the customer earned for, when several ways to earn apply. The newer email layout lists these by itself, so add this only in the older layout or in custom HTML.

Point Redeem

This email confirms that the customer spent points on a reward.

Variable

What it shows

{{points}}

The points spent.

{{rewardName}}

The name of the reward.

{{rewardDiscountCode}}

The reward's discount code. Empty for store credit.

VIP tier emails

The three VIP tier emails each add the tier variables below.

Variable

What it shows

{{tierName}}

The tier the customer reached (VIP Tier Achieved), is about to lose (VIP Tier Expiring Reminder) or has now (VIP Tier Upgrade Reminder).

{% for perk in vipTierPerks %}<p>{{perk}}</p>{% endfor %}

Each perk of the tier (VIP Tier Achieved only).

{{vipTierExpireDate}}

The date the tier expires (VIP Tier Expiring Reminder only).

{{nextTierName}}

The next tier up (VIP Tier Upgrade Reminder only).

The Monthly Reward Reminder has no variables of its own in the standard layout. In custom HTML, it can list your rewards (see Variables in custom HTML).


Variables for referral emails

The referral invite and the new customer's confirmation go to the friend who was referred, so they carry no balance, tier or dates. In all three referral emails, {{customer.display_name}} is the customer who made the referral. Don't use {{customer.first_name}} here, because it always shows "there".

Send referral invite to new customer

This email invites a friend to join. It uses only these variables.

Variable

What it shows

{{customer.display_name}}

The name of the customer who sent the invite.

{{referralLink}}

The invite link.

{{shop.name}}

Your store name.

Referral Acceptance Confirmation for new customer

This email goes to the friend after they accept. It uses only these variables.

Variable

What it shows

{{customer.display_name}}

The name of the customer who referred them.

{{rewardName}}

The friend's discount code. Empty if their reward comes later.

{{referralLink}}

The referral link of the customer who referred them.

{{shop.name}}

Your store name.

Referral Acceptance Confirmation for existing customer

This email goes to the customer who made the referral. It has the variables for most emails, except the first name, and these.

Variable

What it shows

{{referredEmail}}

The email address of the friend who accepted.

{{rewardName}}

The customer's discount code. Empty if their reward comes later.

{{referralLink}}

The customer's own referral link.


Variables in custom HTML

Custom HTML is available on some plans only. If your plan doesn't include it, a banner at the top of the Custom view says so. When you write your own email there, all the variables above work the same way. You can also use the variables that build the standard layout. Your HTML replaces the whole standard email, so the Heading and Message show only where you add {{heading}} and {{ body_content | newline_to_br }}.

Variable

What it shows

{{heading}}

The Heading text.

{{ body_content | newline_to_br }}

The Message text, with its line breaks.

{{ footer }}

The Footer Text.

{{unsubscribeText}}

The Unsubscribe Text.

{{ logo_url }} and {{ logo_height }}

The Header image and the Header image width.

{{available_points_label}}

The Available Points Label text.

{{claimNow}}

The button text.

{{redirectLink}}

Where the button takes the customer.

{{header_background_color}}, {{header_text_color}}, {{ text_color }}, {{templateBackgroundColor}}

The Heading Background Color, Heading Text Color, Content Text Color and Template Background Color from the Design view.

{{footer_background_color}}, {{ footer_text_color }}, {{footer_link_color}}

The footer colors from the Design view.

{{ claimNowButtonBackgroundColor }}, {{ claimNowButtonTextColor }}

The button colors from the Design view.

{% for reward in rewardsSummaries %}<p>{{reward.note}}: {{reward.discount}}</p>{% endfor %}

Each reward customers can redeem, with what it gives. Filled in the Monthly Reward Reminder, and in other emails when Show redeem rules? is on in the Global view.

{% for rule in earnRuleSummaries %}<p>{{rule.ruleName}}: {{rule.ruleDescription}}</p>{% endfor %}

Each way to earn, with what customers get. Filled when Show earn rules? is on in the Global view.

{{rewardsAvailable}} and {{earnRulesAvailableText}}

The Rewards available heading and the Earn rules available heading from the Global view.


Things to know

  • A variable that an email can't fill in shows nothing. The app doesn't show an error.

  • To show backup text when a variable is empty, add | default: '...' inside the brackets, for example {{ruleName | default: 'following reasons'}}.

  • The app fills in each value when it sends the email. A balance is the balance at that moment.

  • This article covers every email that Appstle Loyalty writes, including emails that Mailchimp delivers for you (see Connect Mailchimp to send your loyalty emails). If Klaviyo or Omnisend sends your loyalty emails, you build those emails there, with their own variables: see Connect Klaviyo to send your loyalty emails or Connect Omnisend to send your loyalty emails.

  • For the other settings of each email, see Email Templates.


FAQs

A variable shows nothing in the preview. Why?

Check these causes:

  • The email can't fill it in. Open Add Variable in that email and look for the variable in the list.

  • The example customer has no value for it. For example, {{pointExpireDate}} is empty when points expiry is off.

  • The capital letters are different. {{tierName}} works and {{tiername}} doesn't.

  • It starts with event., as in Klaviyo templates and older guides. Remove event., for example use {{heading}}, not {{ event.heading }}.

The email shows the variable as I typed it, with the curly brackets. Why?

The text is in a field that isn't filled in: Footer Text, Unsubscribe Text, Point Earn Button Text, or a heading in the Global view. Move the variable to the Message or the Heading. Also check that the variable has two curly brackets on each side.

My subject line shows no name or points. Why?

The subject can only use {{shop.name}}. Any other variable comes out empty. To greet the customer by name, put {{customer.first_name | default: 'there'}} in the Heading or the Message.

The preview says "This preview couldn’t load". Why?

Usually, a tag in the email isn't complete, for example a {{ without its }}, or a {% for %} without its {% endfor %}. Until you fix it, Appstle Loyalty doesn't send this email. Undo your last change or check each tag, then click Refresh. If the template looks right and the preview still doesn't load, chat with us.

Did this answer your question?