> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://docs.bloy.io/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# How to use email template variables?

# How to use email variables in BLOY

Email variables in BLOY let you personalize email subjects and email content with customer, reward, referral, Points Program, and VIP Tier data. Add a variable with double curly braces, such as `{{PointBalance}}`, and BLOY replaces it with the real value when the email is sent.

### Prerequisites

Before using email variables, make sure you have:
* Access to the BLOY email template you want to edit.
* The email notification enabled in BLOY.
* The correct variable name for the email type you are editing.
* A real customer event to test the final email output when possible.

### How to insert an email variable

###### Step 1: Open the email template
Open the BLOY email template you want to edit.
Choose the email type that matches the customer event, such as a points earned email, redeemed reward email, referral email, or VIP Tier email.

###### Step 2: Add the variable to the subject or content
Add the variable to the **Subject** or **Content** field.
Use this format:
`{{VariableName}}`
Do not add spaces inside the curly braces.
Correct format:
`{{PointBalance}}`
Incorrect format:
`{{ PointBalance }}`

###### Step 3: Preview the email
Use the email preview to check the layout and placement of each variable.
The values shown in the preview are sample values only. For example, `{{EarningName}}` may show as Celebrate your birthday in the preview, but in a real email it is replaced by the Way to earn that triggered the email.

###### Step 4: Save the email template
Click **Save** after adding or updating variables.
Send a test email or trigger a real event when possible to confirm that each variable is replaced correctly.

### Common variables used across multiple emails
These variables appear in multiple BLOY email types.

| Variable | **What it means** | **Example usage** |
| ---- |
| {{ShopName}} | The store name. | Welcome to `{{ShopName}}` |
| {{PointName}} | The singular name of the point currency. | Start collecting `{{PointName}}` today |
| {{PointsEarned}} | The number of points earned from an event. | You earned `{{PointsEarned}}` |
| {{EarningName}} | The Way to earn that awarded points to the customer. | You earned points from `{{EarningName}}` |
| {{PointBalance}} | The customer's current point balance. | You have `{{PointBalance}}` available |
| {{RewardName}} | The name of the reward the customer redeemed. | You redeemed `{{RewardName}}` |
| {{DiscountCode}} | The discount code generated for a redeemed reward. | Use code `{{DiscountCode}}` |
| {{ReferredReward}} | The reward or discount offered to the referred customer. | Claim `{{ReferredReward}}` |
| {{TierName}} | The VIP Tier name. | Welcome to `{{TierName}}` |
| {{CustomerName}} | The customer's name. | Congratulations, `{{CustomerName}}` |

### Available variables by email type

###### Welcome Customer
The Welcome Customer email is sent when a customer joins or is welcomed into the Points Program.

| Variable | What it means | Example usage |
| ---- |
| {{ShopName}} | The store name. | Welcome to `{{ShopName}}` |
| {{EarningName}} | The Way to earn that awarded points to the customer. | You earned points from `{{EarningName}}` |
| {{PointsEarned}} | The number of points the customer earned. | You earned `{{PointsEarned}}` |
| {{PointName}} | The singular name of the point currency. | Start collecting `{{PointName}}` today |

Subject example:
`Welcome to {{ShopName}}`
Content example:
`Welcome to {{ShopName}}! You earned {{PointsEarned}} from {{EarningName}}.`

###### Points Earned

The Points Earned email is sent when a customer earns points from a Way to earn.

| Variable | What it means | Example usage |
| ---- |
| {{ShopName}} | The store name. | You earned points at `{{ShopName}}` |
| {{EarningName}} | The Way to earn that generated the points. | Reward earned from `{{EarningName}}` |
| {{PointsEarned}} | The number of points earned in this event. | You just earned `{{PointsEarned}}` |
| {{PointName}} | The singular name of the point currency. | Every `{{PointName}}` gets you closer to rewards |

Subject example:
`You earned points at {{ShopName}}`
Content example:
`You earned {{PointsEarned}} from {{EarningName}} on {{ShopName}}.`

###### Points Redeemable

The Points Redeemable email is sent when a customer has enough points to redeem a reward.

| Variable | What it means | Example usage |
| ---- |
| {{ShopName}} | The store name | Redeem your reward at `{{ShopName}}` |
| {{PointBalance}} | The customer's current point balance. | You have `{{PointBalance}}` available |
| {{PointName}} | The singular name of the point currency. | Use your `{{PointName}}` balance |
| {{PointExpiry}} | The point expiration setting, shown as the number of months before points expire. | Your points expire after `{{PointExpiry}}` months |
/

Subject example:
`You have points to redeem at {{ShopName}}`
Content example:
`You have {{PointBalance}} on {{ShopName}}. Visit the store to redeem a reward.`
###### 
###### Points Redeemed
The Points Redeemed email is sent after a customer redeems points for a reward.

| Variable | What it means | Example usage |
| ---- |
| {{ShopName}} | The store name | Redeem your reward at {{ShopName}} |
| {{RewardName}} | The name of the reward the customer redeemed. | You redeemed `{{RewardName}}` |
| {{PointsRedeemed}} | The number of points used for the redemption. | You used `{{PointsRedeemed}}` |
| {{DiscountValue}} | The discount value of the reward. | Your discount is `{{DiscountValue}}` |
| {{DiscountCode}} | The discount code generated for the reward. | Use code `{{DiscountCode}}` |
| {{MinimumPurchaseAmount}} | The minimum purchase amount required to use the reward, if configured. | Minimum purchase: {{MinimumPurchaseAmount}} |
| {{MinimumPurchaseQuantity}} | The minimum item quantity required to use the reward, if configured. | Minimum quantity: `{{MinimumPurchaseQuantity}}` |
| {{MaximumShippingAmount}} | The maximum shipping amount covered by the reward, if configured. | Maximum shipping discount: `{{MaximumShippingAmount}}` |
| {{PointName}} | The singular name of the point currency. | Thanks for using your `{{PointName}}` balance |

Subject example:
`Your reward from {{ShopName}}`
Content example:
`You redeemed {{RewardName}} for {{PointsRedeemed}}. Use code {{DiscountCode}} at {{ShopName}}.`

###### Birthday Reward

The Birthday Reward email is sent when a customer receives a birthday reward.

| Variable | What it means | Example usage |
| ---- |
| {{ShopName}} | The store name. | A birthday gift from `{{ShopName}}` |
| {{EarningName}} | The Way to earn that awarded the birthday points. | Reward reason: `{{EarningName}}` |
| {{PointsEarned}} | The number of birthday points awarded. | You received `{{PointsEarned}}` |
| {{PointName}} | The singular name of the point currency. | Enjoy your birthday `{{PointName}}` reward |

Subject example:
`A birthday gift from {{ShopName}}`
Content example:
`Happy birthday! You received {{PointsEarned}} from {{EarningName}} at {{ShopName}}.`

###### Point Expiration

The Point Expiration email is sent to remind a customer about points that are close to expiration.

| Variable | What it means | Example usage |
| ---- |
| {{ShopName}} | The store name. | Your points at `{{ShopName}}` |
| {{PointBalance}} | The customer's current point balance. | You still have `{{PointBalance}}` |
| {{PointName}} | The singular name of the point currency. | Use your `{{PointName}}` before it expires |
### 
Subject example:
`Your points at {{ShopName}}`
Content example:
`You have {{PointBalance}} at {{ShopName}}. Redeem your {{PointName}} before it expires.`

###### Referral Sharing

The Referral Sharing email is sent when a customer shares a referral email with a friend.

| Variable | What it means | Example usage |
| ---- |
| {{ShopName}} | The store name. | Your friend invited you to `{{ShopName}}` |
| {{ReferredReward}} | The reward or discount offered to the referred customer. | Get `{{ReferredReward}}` off your order |
| {{Message}} | The personal message entered by the referring customer. | Message from your friend: `{{Message}}` |
### 
Subject example:
`Your friend invited you to {{ShopName}}`
Content example:
`Your friend invited you to {{ShopName}}. Claim {{ReferredReward}} today.`

###### Points Referrer

The Points Referrer email is sent to the referring customer when they earn points from a successful referral.

| Variable | What it means | Example usage |
| ---- |
| {{ShopName}} | The store name. | Referral reward from `{{ShopName}}` |
| {{PointsEarned}} | The number of points the referrer earned. | You earned `{{PointsEarned}}` |
###### 
Subject example:
`Referral reward from {{ShopName}}`
Content example:
`Your referral was successful. You earned {{PointsEarned}} at {{ShopName}}.`

###### Rewards Referred

The Rewards Referred email is sent to the referred customer when they receive a referral reward.

| Variable | What it means | Example usage |
| ---- |
| {{ShopName}} | The store name. | Your reward from `{{ShopName}}` |
| {{ReferredReward}} | The reward or discount value offered to the referred customer. | You received `{{ReferredReward}}` |
| {{CouponCode}} | The discount code the referred customer can use. | Use code `{{CouponCode}}` |
###### 
Subject example:
`Your reward from {{ShopName}}`
Content example:
`You received {{ReferredReward}} from {{ShopName}}. Use discount code {{CouponCode}}.`

###### Welcome New Tier

The Welcome New Tier email is sent when a customer reaches or enters a new VIP Tier.

| Variable | What it means | Example usage |
| ---- |
| {{ShopName}} | The store name. | Your VIP status at `{{ShopName}}` |
| {{TierName}} | The VIP Tier name. | Welcome to `{{TierName}}` |
| {{CustomerName}} | The customer's name. | Congratulations, `{{CustomerName}}` |
| {{ResetDate}} | The VIP Tier reset or review date. | Your tier resets on `{{ResetDate}}` |
| {{TierBenefits}} | The list of benefits for the customer's VIP Tier. This may render as multiple lines or HTML content in the email. | Your benefits: `{{TierBenefits}}` |
###### 
Subject example:
`Welcome to {{TierName}}`
Content example:
`Congratulations, {{CustomerName}}! You reached {{TierName}} at {{ShopName}}.`

###### Demotion Reminder

The Demotion Reminder email is sent before a customer may be moved down from their current VIP Tier.

| Variable | What it means | Example usage |
| ---- |
| {{ShopName}} | The store name. | VIP reminder from `{{ShopName}}` |
| {{DaysLeft}} | The number of days left before the possible tier demotion. | You have `{{DaysLeft}}` days left |
| {{TierName}} | The customer's current VIP Tier name. | Keep your `{{TierName}}` tier |
###### 
Subject example:
`VIP reminder from {{ShopName}}`
Content example:
`You have {{DaysLeft}} days left to keep your {{TierName}} tier at {{ShopName}}.`

### Pro tips

* Use only the variables listed for the email type you are editing. A variable that works in one email may not work in another email.
* Keep subject lines short. Use one main variable, such as `{{ShopName}}`, `{{RewardName}}`, or `{{TierName}}`.
* Use real events to test important templates, especially reward, referral, and VIP Tier emails.
* Remove optional reward variables if the related reward setting is not configured.

### Troubleshooting

###### Variable appears as plain text in the sent email
Check that the variable name is spelled correctly and uses double curly braces.
For example, use `{{PointBalance}}`, not `{PointBalance}` or `{{ PointBalance }}`.

###### Preview value does not match the real email value
Preview values are sample values only.
Trigger a real customer event, such as earning points or redeeming a reward, to confirm the final value in the sent email.

###### A reward variable is empty in the email
Some variables only show a value when the related reward setting exists.
For example, `{{MinimumPurchaseAmount}}`, `{{MinimumPurchaseQuantity}}`, and `{{MaximumShippingAmount}}` should only be used when those reward conditions are configured.

### Related articles
* [How to send automated emails?](https://docs.bloy.io/en/article/how-to-send-automated-emails-1llshou/)
* [How to create a way to earn?](https://docs.bloy.io/en/article/how-to-create-a-way-to-earn-83x9xx/)
* [How to create a way to redeem?](https://docs.bloy.io/en/article/how-to-create-a-way-to-redeem-1si9iiz/)
* [How to set up VIP program?](https://docs.bloy.io/en/article/how-to-set-up-vip-program-njhlmj/)

