If true

Conditionally merges different content depending on whether a value is true. Use it with yes or no fields, such as an opt-in flag or a preference switch.

Syntax

{{#ifTrue data}}true content{{else}}false content{{/ifTrue}}

Parameters

Name Type Required Description
Data Text Required The value to evaluate. It is treated as true only when it reads true, in any capitalization.
Note: Only the word true counts as true. Values such as yes, 1, or on are treated as false, so the false content shows. If your data uses those, compare it directly with If equal instead.

Examples

The examples below are based on the following sample content:

{{#ifTrue Contact.smsOptIn}}You are signed up for text alerts.{{else}}Want text alerts too?{{/ifTrue}}

A. smsOptIn is true

You are signed up for text alerts.

B. smsOptIn is false, empty, or says "yes"

Want text alerts too?

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us