Documentation >> Conditionals >> Messages >> enclosures >> msg.enclosures.length
Message Conditional Macro: msg.enclosures.length
Operators:
- == (equal to)
- != (not equal to)
- greaterThan
- greaterThanOrEqualTo
- lessThan
- lessThanOrEqualTo
Usage Notes
- Tests the number of enclosures in the message, comparing that number with the |conditional value| on the right side of the |conditional operator|.
- This is a simple numerical test, so the conditional value must be a number.
Examples
In this example, the second line will be shown because this message contains two enclosures.
<!--#if condition="msg.enclosures.length == '0'"-->
1. This message has no enclosures.
<!--#elseif condition="msg.enclosures.length <= '5'"-->
2. This message has at least one but no more than five enclosures.
<!--#else-->
3. This message has lots of enclosures.
<!--#endIf-->
See the above code in action, here:
2. This message has at least one but no more than five enclosures.
View in DG
|