The CreatorCon Call for Content is officially open! Get started here.

Email Notification Message HTML Being Modified by System on Update

jlaps
Kilo Sage

So our email notifications have complex formatting using tables, and if ANY thing is changed within the notification itself, even if nothing to do with the formatting, the system changes the formatting of the MESSAGE HTML and breaks the tables and view. We have to manually copy the HTML MESSAGE from the list view to notepad, make the changes to the notification that is needed, and after updating so we are back in the list view, then copy the notepad code back into MESSAGE HTML from the list view.

 

This is dumb and is being consistently forgotten by people, resulting in broken notifications. I am trying to devise a solution.

I have created a new VALID HTML field of the same type as MESSAGE HTML and copied the good code into this new field. I tried with an UPDATE AFTER business rule, or ASYNC, but I don't think it is possible from a RULE to get the good code in there as it always gets updated and broken.

Can you think of a good way to copy back the good HTML after editing a notification?

8 REPLIES 8

Kieran Anson
Kilo Patron

It sounds like ServiceNow's HTML sanitiser is stripping data/attributes from your message body html. As a simple check, you can add the html_sanitize=false dictionary attribute to see if the html breaks after a further update to the form.

Enabling sanitization on individual fields (servicenow.com)

I tried this, I think-

jlaps_0-1715102708016.png

So long as I did not make a mistake on the above, this does not resolve the issue. Thanks!

I think I did it in wrong spot above, but I think this is correct and still no go-

jlaps_1-1715103003118.png

 

Are you able to share the table formatting before and after to try and understand why it's being manipulated on form update? I'm not a fan of sticky plaster fixes in system as they become harder to manage