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 wordtruecounts as true. Values such asyes,1, oronare 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?