- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2014 06:13 AM
Hi All
If I'd like to I omit watermark from scheduled report emails, how can I do that? Unlike in email notifications, there is no omit watermark option in scheduled report emails.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2014 09:19 AM
While Chandan's reply was excellent, I don't think it will help in this situation. Scheduled Reports don't go through the Notifications table, and there is no "Omit Watermark" field on the sysauto_report table.
I think the best solution in this case would be to create a "before insert" business rule on the sys_email table, that looks for part of the expected subject line of the scheduled report emails, and then looks for the watermark and removes it.
This would look something like:
Condition: current.type == 'send-ready' && current.subject.toString().indexOf("Scheduled Execution of") >= 0
Script:
current.body = String(current.body).replace(/Ref\:MSG(?:[0-9]*)/i, "");
current.body_text = String(current.body_text).replace(/Ref\:MSG(?:[0-9]*)/i, "");
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2014 06:22 AM
Just to clarify, I do not want to hide watermarks globally, but only on individual scheduled emails.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2014 06:28 AM
Email Notifications - ServiceNow Wiki
Please follow the link, this has been described there clearly..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2014 09:19 AM
While Chandan's reply was excellent, I don't think it will help in this situation. Scheduled Reports don't go through the Notifications table, and there is no "Omit Watermark" field on the sysauto_report table.
I think the best solution in this case would be to create a "before insert" business rule on the sys_email table, that looks for part of the expected subject line of the scheduled report emails, and then looks for the watermark and removes it.
This would look something like:
Condition: current.type == 'send-ready' && current.subject.toString().indexOf("Scheduled Execution of") >= 0
Script:
current.body = String(current.body).replace(/Ref\:MSG(?:[0-9]*)/i, "");
current.body_text = String(current.body_text).replace(/Ref\:MSG(?:[0-9]*)/i, "");
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2014 11:37 AM
In general, a rule like this would do the trick. But although by default the subject of scheduled reports contains "Scheduled Execution of", it can be easily changed by the user, in which case the script will fail. Filtering by Target Table is therefore more reliable:
current.type == 'send-ready' && current.target_table == 'sysauto_report'
Blog: https://sys.properties | Telegram: https://t.me/sys_properties | LinkedIn: https://www.linkedin.com/in/slava-savitsky/