Your team can create a single campaign in Positive User that dynamically changes content for each contact depending on their profile details. Instead of building multiple campaign versions, conditional logic lets you adapt text, offers, and greetings automatically.
For more details on basic profile placeholders, read our guide on “What Is Dynamic Content”.
{% else %} tag. Every conditional block must begin with {% if %} and end with {% endif %} to render properly.The {% if %} tag checks whether a specific attribute exists, is not empty, or evaluates to true. When the condition is true, Positive User displays the text inside that block. Add an optional {% else %} tag to show alternative content if the condition is false. End the block with {% endif %}.
Use basic if statements when you want to show or hide a block of text based on whether a contact attribute exists or meets a single condition.
Imagine you want to send a congratulatory message to contacts who have registered employees in their account, while offering hiring tips to those who haven't. Instead of writing two separate messages, you can use a basic if statement with an else fallback.
Example:
{% if receiver.employee_number %}
Congratulations on getting {{receiver.employee_number}} employees!
{% else %}
Click here to learn how to hire new specialists
{% endif %}Use elif statements when you have multiple messaging variations and want Positive User to evaluate conditions in a specific sequence.
Start your block with {% if %} for your primary condition. Insert {% elif %} tags for each additional condition you want to test. Positive User checks each rule from top to bottom and renders text for the first condition that evaluates to “true”. Positive User falls back to your {% else %} clause to display default content. At the end you need to close the block with {% endif %}.
Suppose you want to greet contacts personally. If you have both their first and last name, you say "Hello [First name] [Last name]". If you only have their last name, you say "Hello Mr. [Last name]". If neither is available, you fall back to a friendly default like "Hello our dear Friend!".
Example:
{% if receiver.first_name and receiver.last_name %}
Hello {{ receiver.first_name }} {{ receiver.last_name }}
{% elif receiver.last_name %}
Hello Mr. {{ receiver.last_name }}
{% else %}
Hello our dear Friend!
{% endif %}if tag may take one or several {% elif %} clauses, as well as an {% else %} clause that will be displayed if all previous conditions fail. These clauses are optional.Use operators when you need to evaluate numeric thresholds, compare exact text, or check for specific conditions.
Select from available comparison operators:
Use == (equals) or != (does not equal) for exact text or value matches.
Use <, >, <=, or >= for numeric thresholds.
Use in or not in to check if text contains specific terms.
Use is or is not to check specific states.
Add your operator and comparison value inside the condition tag. Write your condition tag including the attribute, operator, and comparison value, followed by optional {% elif %} or {% else %} tags and {% endif %}.
You might want to reward loyal customers who have made 15 or more purchases with a special thank-you note, while sending an encouraging message to those with fewer than 10 purchases.
Example:
{% if receiver.purchased_products >= 15 %}
15 orders later, you’re officially a VIP—thank you for being so loyal!
{% elif receiver.purchased_products < 10 %}
We see your love for the brand growing, and we are so here for it!
{% endif %}Use complex statements when messaging depends on multiple criteria working together.
Complex statements combine multiple rules using logical operators like and (all conditions must be met) or or (at least one condition must be met). Positive User checks the combined criteria inside the tag before deciding whether to render the primary message or move to the {% else %} fallback clause.
Decide whether your content requires contacts to meet every condition (and) or match any single condition (or). Write your complete condition statement containing multiple criteria inside a single tag, and include an {% else %} clause for default content. Remember about {% endif %} at the end.
Imagine you want to send spending updates only to contacts whose recorded revenue is exactly 100 or 150, while prompting everyone else to start spending.
{% if receiver.revenue == 100 or receiver.revenue == 150 %}
Here is your daily spending
{% else %}
Click here to start spending your money!
{% endif %}Subscription Plan Offers: You can create a single email, SMS, or chat campaign that automatically checks a contact's subscription plan using the in operator. Contacts on a monthly plan receive a 35% discount code, while contacts on a yearly plan receive a 50% discount code.
Car Fleet Rental Messaging: A rental car service can send dynamic messages tailored to each contact's favorite rental car brand. Audi drivers receive an Audi rental voucher, BMW drivers get feedback prompts, and Mercedes drivers receive accessory vouchers.