Application management : Configuration : System Settings : Reporting : Encode Planon data in HTML mail merge
Encode Planon data in HTML mail merge
If this setting is set to No when executing an HTML mail merge:
Planon data is merged with the HTML template.
The merged HTML end result is partially encoded and cleaned. The partial encoding means that some known problematic characters in HTML are replaced, but URLs and e-mail addresses remain unchanged. In the cleaning phase, the resulting HTML is stripped from invalid/incomplete HTML tags and JavaScript.
If this setting is set to Yes when executing an HTML mail merge:
All text entered in Planon data will be shown literally in the browser, no text will be interpreted or executed by the browser, except when the HTML template defines that a URL or email address is required.
The HTML of the mail merge template will not be cleaned anymore, so any existing JavaScript in the template will remain.
The following rules and examples illustrate what happens if the setting is set to Yes.
Fields: if a field is included in the HTML mail merge template as a regular field, the data is encoded:
Field type
Field content
Result in merge html (source)
String
<b>hello</b>
&lt;b&gt;hello&lt;/b&gt;
StringExten­ded
<b>hello 'world' </b>
&lt;b&gt;hello&#x20;&#x27;world&#x27; &lt;&#x2f;b&gt;
StringExten­ded
URL
https://www.facebook.com/
https&#x3a;&#x2f;&#x2f;www&#x2e; facebook&#x2e;com&#x2f;
String
me@me.nl
me&#x40;me&#x2e;nl
StringExten­ded
<script>window.alert ('show me');</script>
&lt;script&gt;window&#x2e;alert&#x28; &#x27;show&#x20; me&#x27;&#x29;&#x3b; &lt;&#x2f;script&gt;
Expressions that have a string as input and a string as output will be encoded.
formatString
pretty
substring
toLower
toUpper
trim
String constants are NOT encoded.
Operators that are encoded:
+
If (Boolean condition) Then (result1) Else (result2)
The result of an if function IS encoded
Fields used in the Boolean condition are NOT encoded
Example: the field properties.Comment contains the data <b>hello</b>
Expression
Result in HTML source
Displayed in browser as
substring(Properties.­Comment,0,5)
&lt;b&gt;he
<b>he
"<i>" + substring( Properties.­Comment,0,5) + "</i>"
<i>&lt;b&gt;he</i>
<b>he
(if (Orders.Comment = ­"<b>hoi</b>") then "HOI" else "BOO")
BOO
BOO
(if (Orders.Comment = "<b> hello </b>") then "<b>HOI</b>" else "BOO")
<b>HOI</b>
HOI
If the HTML template uses Planon data (in the examples field <test>) to come to a HTML construct like a URL or a 'mailto' reference, then the encoding will behave differently and the Planon data will not be encoded.
URL
HTML template snippet
<a href="&lt;test&gt;">test</a>
Input in url field
https://www.facebook.com
Resulting HTML
<a href="https://www.facebook.com/">test</a>
Image
HTML template snippet
<img src="&lt;test&gt;">
Input in url field
http://nl-devs95:18370/webdav/image.JPG
Resulting HTML
<img src="http://nl-devs95:18370/webdav/image.JPG" />
JavaScript
HTML template snippet
<script>window.alert('&lt;test&gt;');</script>
Input in url field
My popup
Resulting HTML
<script>window.alert('My&#x20;popup');</script>