--- title: "Use Cases" slug: "liquid-tags-use-cases" description: "Covers Liquid use cases in Insider One, including personalization, conditional content, loops, calculations, date formatting, and dynamic campaign content." updated: 2026-04-10T09:05:55Z published: 2026-04-10T09:05:55Z canonical: "academy.insiderone.com/liquid-tags-use-cases" --- > ## Documentation Index > Fetch the complete documentation index at: https://academy.insiderone.com/llms.txt > Use this file to discover all available pages before exploring further. # Use Cases ## Basic personalization You can greet the user by name, show city-specific content, and acknowledge loyalty tier. **Step 1**: Greet with a fallback ```plaintext Hello {{ name | default: "there" }}, ``` **Step 2**: Add city-based content ```plaintext Hello {{ name | default: "there" }}, {% if city != blank %} We have a special offer for customers in {{ city }}. {% endif %} ``` **Step 3:** Add loyalty tier branch ```plaintext 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. ```plaintext {% 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. ```plaintext {% 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. ```plaintext {% 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” case using date with time zone You can show the membership date formatted for the user's region. ```plaintext {% 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 %} ``` ## Short and character-aware SMS You can tight personalized SMS using truncate and default. ```plaintext {% 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. ```plaintext {% 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 (currency) formatting You can calculate a price with tax and format it as currency in a single template block. ```plaintext {% assign base = c_wallet_balance | default: 0 %} {% assign with_tax = base | times: 1.18 | round: 2 %} {{ with_tax | number_format: "dot, comma" }} ---> 118,00 {{ with_tax | money_format: "€", "dot, comma" }}  ---> €118,00 ``` number_format only formats the numeric separators; money_format formats the value as money, adds the **currency** symbol, and always **rounds** to 2 decimal places. ## Guard clause pattern You can validate all required data at the top before rendering any content. Fail fast with clear reasons. ```plaintext {% 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. ```