Use Cases

Prev Next

Basic personalization

You can greet the user by name, show city-specific content, and acknowledge loyalty tier.

Step 1: Greet with a fallback

Hello {{ name | default: "there" }},

Step 2: Add city-based content

Hello {{ name | default: "there" }},

{% if city != blank %}
We have a special offer for customers in {{ city }}.
{% endif %}

Step 3: Add loyalty tier branch

Hello {{ name | default: "there" }},

{% if city != blank %}
We have a special offer for customers in {{ city }}.
{% endif %}

{% if c_loyalty_tier == "gold" %}
As a Gold member, you enjoy free shipping on every order.
{% elsif c_loyalty_tier == "silver" %}
Upgrade to Gold to unlock free shipping.
{% else %}
Join our loyalty program to start earning rewards.
{% endif %}

Last purchase reminder

You can remind a user to reorder their last purchased product.

{% if c_last_purchased_product == blank %}
  {% abort_message "No purchase history — skipping replenishment campaign" %}
{% endif %}

Hello {{ name | default: "there" }},

Still stocking up on {{ c_last_purchased_product }}?
It may be time to reorder.

Loyalty tier segment

You can show different content for each loyalty tier and handle the non-member cases.

{% if c_loyalty_tier == blank %}
  {% abort_message "User not enrolled in loyalty program" %}
{% endif %}

{% case c_loyalty_tier %}
  {% when "gold" %}
    As a Gold member, you get 48-hour early access to our sale.
  {% when "silver" %}
    As a Silver member, you get 24-hour early access to our sale.
  {% when "bronze" %}
    As a Bronze member, use code BRONZE10 for 10% off.
  {% else %}
    Our sale is now live — don't miss out!
{% endcase %}

Birthday greeting

You can send a personalized birthday message with the formatted date.

{% if birthday == blank %}
  {% abort_message "No birthday on file" %}
{% endif %}

{% assign birth_month = birthday | time_format: "MM" %}
{% assign current_month = "now" | date: "%m" %}

{% if birth_month == current_month %}
  Happy birthday, {{ name }}!
  Wishing you all the best on {{ birthday | time_format: "DD MMMM" }}.
  Here is a birthday gift from us: use code BDAY20 for 20% off.
{% else %}
  {% abort_message "Not user's birth month" %}
{% endif %}

Member since — date with time zone

You can show the membership date formatted for the user's region.

{% if c_membership_date == blank %}
  {% abort_message "No membership date" %}
{% endif %}

Hello {{ name | default: "there" }},

You have been a member since {{ c_membership_date | timezone: "Europe/Istanbul" | time_format: "DD MMMM YYYY" }}.

{% assign orders = c_total_orders | default: 0 %}
{% if orders > 0 %}
You have placed {{ orders }} orders with us — thank you!
{% endif %}

SMS — short and character-aware

You can tight personalized SMS using truncate and default.

{% if name == blank %}
  {% abort_message "Missing user name" %}
{% endif %}

{% assign short_name = name | truncate: 10, "" | default: "Customer" %}

Hi {{ short_name }},
{% if c_loyalty_tier != blank %}Your {{ c_loyalty_tier | upcase }} discount has been applied.{% else %}Your exclusive offer is ready.{% endif %}

Dynamic subject line with capture

You can build a personalized subject line conditionally.

{% capture subject %}
  {% if c_loyalty_tier == "gold" %}
    Your exclusive Gold offer is ready, {{ name }}
  {% elsif c_loyalty_tier == "silver" %}
    Silver member special inside, {{ name }}
  {% else %}
    A special offer just for you, {{ name | default: "there" }}
  {% endif %}
{% endcapture %}

Subject: {{ subject | strip }}
Body: Hello {{ name | default: "there" }}, ...

Price calculation with formatting

You can calculate a price with tax and format it.

{% assign base = c_last_order_amount | default: 0 %}
{% assign with_tax = base | times: 1.18 | round: 2 %}
{% assign formatted = with_tax | number_format: "dot, comma" %}

Your estimated total including tax: {{ formatted }} TL

Guard clause pattern

You can validate all required data at the top before rendering any content. Fail fast with clear reasons.

{% if email == blank %}{% abort_message "No email address" %}{% endif %}
{% if name == blank %}{% abort_message "No name on profile" %}{% endif %}
{% if c_loyalty_tier == blank %}{% abort_message "Not a loyalty member" %}{% endif %}

Hello {{ name }},

Your {{ c_loyalty_tier | capitalize }} member offer expires soon.
Don't miss out — use code {{ c_loyalty_tier | upcase }}SAVE at checkout.