- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-18-2020 05:08 AM
We get emails from third party vendor servicenow instance to my client instance related to vendor incident and service requests. As soon as the email hits the client instance, a call record has to be created. I configured an inbound email action for this but the incoming vendor email has watermark because of this my inbound action is not triggered and the email is getting ignored. Could anyone please let me know the script to remove watermark from email body.
I referred this post: https://community.servicenow.com/community?id=community_question&sys_id=bb064b61db1cdbc01dcaf3231f9619a6 but I am not sure on the code of how to remove the watermark from email body.
So any scripting help on this is really appreciated.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-18-2020 05:59 AM
Hi,
You can try below (untested) a business rule that runs before insert/update on sys_email table.
When to Run: Required conditions or recipient list to make it specific. Else it will run for all mail that are received.
Suppose, Subject contains ABC
Script:
(function executeRule(current, previous /*null when async*/ ) {
var getwatermark = new GlideRecord('sys_email');
getwatermark.query();
if (getwatermark.next()) {
var bodyhastext = getwatermark.body;
bodyhastext = bodyhastext.replace(/MSG0042550/g, '');//Suppose my watermark is of form : //Ref:MSG0042550 so it replaces it with empty
getwatermark.body = bodyhastext;
getwatermark.update();
}
//Ref:MSG0042550
})(current, previous);
You can use your own logic as per your watermark text. In case you can also use split or substring methods for removing watermark,
Note: This has high impact on the performance of system

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-18-2020 05:14 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-18-2020 05:16 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-18-2020 05:17 AM
Hi Both,
"Omit watermark" is for outgoing notifications. I am asking about inbound emails
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-18-2020 05:21 AM