Placeholders with HTML code (Mail Builder)

Some characters, if part of the event data, can lead to problems with mailing display. If, for example, event data contains opening and closing angle brackets (< >), they would usually be interpreted by Inxmail Commerce as the start or end of HTML code. Normally, however, this is not desired.

For this reason, these characters in event data are automatically HTML escaped in Inxmail Commerce, so that they are not interpreted as HTML code. This ensures that mailings remain correctly displayed.

You can disable automatic HTML escaping by inserting text.unescapeHtml in front of the placeholder and enclosing the placeholder itself in round brackets: ${text.unescapeHtml(placeholder)}

The following tables use examples to provide an overview of the results with automatic HTML escaping and its disabling. The characters are listed for the HTML version and the text version of the mailing.

Automatic HTML escaping

With automatic HTML escaping, the syntax of the placeholder remains unchanged: ${placeholder}

Mailing editor

Version

Characters in the editor

HTML version

<body>${Order.Text}</body>

Text version

-${Order.Text}-

 

Sent mailing

Event data

HTML source code

Text

'H &amp; M'

'<body>H &amp;amp; M</body>'

'-H &amp; M-'

'<p>'

'<body>&lt;p&gt;</body>'

'<p>'

'H & M'

'<body>H &amp; M</body>'

'-H & M-'

'&lt;p&gt;'

'<body>&amp;lt;p&amp;gt;</body>'

'-&lt;p&gt;-'

Disabling of automatic HTML escaping

When disabling automatic HTML escaping, you must use the following syntax: ${text.unescapeHtml(placeholder)}

Mailing editor

Version

Characters in the editor

HTML version

<body>${text.unescapeHtml(Order.Text)}</body>

Text version

-${text.unescapeHtml(Order.Text)}-

 

Sent mailing

Event data

HTML source code

Text

'H &amp; M'

'<body>H &amp; M</body>'

'-H & M-'

'<p>'

'<body><p></body>'

'--'

'H & M'

'<body>H & M</body>'

'-H & M-'

'&lt;p&gt;'

'<body>&lt;p&gt;</body>'

'-<p>-'