Documentation >> Conditionals >> Messages >> body >> msg.body
Message Conditional Macro: msg.body
Operators:
- == (equal to)
- != (not equal to)
- greaterThan
- greaterThanOrEqualTo
- lessThan
- lessThanOrEqualTo
- beginsWith
- endsWith
- contains
Usage Notes
- Tests the body text of the current message, comparing it with the |conditional value| on the right side of the |conditional operator|.
- This is a standard text conditional. The full range of operators can be used with this conditional. Comparisons such as greaterThan and lessThan are based on the letters that make up the text. For example, "development" is greater than "condition", because the letter d follows c in the alphabet.
- Other operators, such as beginsWith, endsWith, and contains, are "phrase based", meaning that the entire conditional value must appear in the body (at the beginning for the beginsWith operator, at the end for the endsWith operator, or anywhere in the body text for the contains operator.
- This conditional is not case sensitive, meaning that "ABCDE" is equivalent to "abcde".
- Note that the body text of the message is compared without evaluating any macros that it might contain. Also, HTML tags are simply counted as additional text, so "<b>something</b>" is not the same as "something".
- For further details on text conditionals, see the conditional documentation.
Examples
In this example, the first line will be seen because this message contains the phrase "standard text conditional", at the beginning of the second bullet point in the Usage Notes, above.
<!--#if condition="msg.body contains 'standard text conditional'"-->
1. This message contains the phrase "standard text conditional".
<!--#else-->
2. The phrase you were looking for isn't in this message.
<!--#endIf-->
See the above code in action, here:
1. This message contains the phrase "standard text conditional".
View in DG
|