NiceSender supports basic Liquid syntax, allowing you to automatically adapt email content based on recipient parameters. This makes your campaigns more personalized and relevant to each customer, increasing engagement.

Table of Contents

Why Dynamic Content Matters

With dynamic content you can:

  • Use personalized salutations (e.g., including the recipient’s name)
  • Display a bonus balance or loyalty program status
  • Change text based on age, interests, or other parameters
  • Create varied content depending on recipient data

This way an email becomes not a mass mailing but an individual message to each customer.

Important: In the NiceSender email builder, every element in the "Properties" section has a "Display Conditions" setting. By default, the condition is "Empty", but you can enable conditional logic directly in the visual interface.

If you use a third‑party service to create a template and then import the finished HTML into NiceSender, this article will help you place dynamic constructs inside the layout. The same approach applies if you want to insert conditional operators into an HTML block in NiceSender's email builder or HTML editor.

Examples of Using Dynamic Content in Email Messages

General structure of a dynamic content construct in Liquid

{% if ['age'] > 30 %}
  This content will be shown to people over 30
{% endif %}

Where:

  • ['parameter_name'] – a parameter pre‑defined in the recipient group (use the exact name you created)
  • Comparison operator – any of those listed below
  • Comparison component – an arbitrary number or string to compare the parameter value with

Example 1: Displaying a Bonus Balance

Task: Send a newsletter about bonus balance status to customers of an online store.

1. Data preparation
Create a new recipient group with the [‘bonus_points’] parameter. Upload a list of recipients with their bonus points.

2. Preparing the email layout
Create a new campaign. In the “Design and content” section, select your HTML template and upload it. Where you want to display bonus information, use the following Liquid construct:

<div>Hello, customer!</div>
{% if ['bonus_points'] > 0 %}
  <div>You have {{ ['bonus_points'] }} bonus points. Use them before the end of the year.</div>
{% elsif ['bonus_points'] == 0 %}
  <div>You have no bonus points on your account.</div>
{% elsif ['bonus_points'] == null or ['bonus_points'] == '' %}
  <div>Please contact us to activate your bonus card.</div>
{% endif %}
<div>See you soon! Your store.</div>

Result for recipients

If they have bonuses (e.g., 1000):

Hello, customer!
You have 1000 bonus points. Use them before the end of the year.
See you soon! Your store.

If they have no bonuses (0):

Hello, customer!
You have no bonus points on your account.
See you soon! Your store.

Important notes:

  • The number of conditions is unlimited but cannot be less than one.
  • The block with content that does not match any of the conditions (the else part) can be omitted.
  • The construct can be used anywhere in the email layout: in the subject line, text blocks, button texts, etc.

Example 2: Content Based on Registration Time and Number of Orders

This example shows how to offer different bonuses depending on customer history.

{% if ['months_since_registration'] >= 6 and ['number_of_orders'] >= 3 %}
  <p>You've been with us for {{ ['months_since_registration'] }} months and made {{ ['number_of_orders'] }} orders. Especially for you: 10% increased cashback!</p>

{% elsif ['months_since_registration'] >= 1 %}
  <p>Thank you for being with us for {{ ['months_since_registration'] }} months!</p>

{% else %}
  <p>Welcome to our store! Get free delivery on your first order.</p>

{% endif %}
  • If a customer has been registered for 6 months and has placed 3 or more orders, they are offered a higher cashback rate.
  • If at least 1 month has passed, a more general thank-you message is displayed.
  • A welcome message is displayed for newly registered users.

Example 3: Logical Operators

Here’s an example that takes three parameters at once: age, gender, and interest. Please note that we do not specify exact ages in the texts themselves.

{% if (['age'] >= 30) and (['gender'] == 'male') and (['interest'] == 'sports') %}
  <p>Great selection of sportswear and accessories, especially for you!</p>

{% elsif (['age'] >= 30) and (['gender'] == 'male') and (['interest'] == 'auto') %}
  <p>New car gadgets and accessories might interest you.</p>

{% elsif (['age'] >= 30) and (['gender'] == 'female') and (['interest'] == 'cosmetics') %}
  <p>Check out our new line of natural ingredient cosmetics.</p>

{% elsif (['age'] >= 30) and (['gender'] == 'female') and (['interest'] == 'fashion') %}
  <p>We have new exclusive fashion collections that might be perfect for you.</p>

{% else %}
  <p>We have many interesting offers for different customer categories!</p>

{% endif %}
  • The logical operators `and` and `==` allow you to check multiple conditions at once.
  • If none of the conditions are met, the `else` block is executed and the default option is displayed.

Comparison Operators

To use dynamic elements correctly, it is important to understand comparison operators meaning:

  • > greater than
  • < — less than
  • >= — greater than or equal to
  • <= — less than or equal to
  • == — equal to
  • != — not equal to
  • contains — checks if a string contains a substring
  • or — logical OR
  • and — logical AND

Important Notes

  • Testing dynamic content: Before launching, check how content displays for different user groups. In NiceSender, you can send a test email or use the preview function.
  • No parameter nesting: In Liquid, you cannot substitute one parameter inside another.
  • Parameter names: Use the exact names you created for your parameters (they are case‑sensitive). For consistency, we recommend using lowercase English names without spaces.

Using dynamic content in NiceSender’s HTML templates allows you to personalize your campaigns, increase subscriber engagement, and improve email conversion rates. Try implementing personalization in your next campaign!

For a more in‑depth exploration of Liquid’s capabilities, refer to the official documentation:

Liquid Documentation

Visited 1 times, 1 visit(s) today