- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-16-2017 12:24 AM
Ave.
I have in the system several email accounts defined and each email that gets out of the system should have the "From:" address correctly set.
So far I was able to manage all that using templates, scripts, etc. but I hit the wall when I defined scheduled report.
So I have schedule report that is sending email with generated PDF.
The sysauto_report table has subject and report_body, but has no more details in regards to created sys_email.
Could you please help me find how sys_email is generated from sysauto_report?
If in the process is used a script or a template or if it is totally hardcoded and I need to create business rule to manage this before it gets sent.
I would like to avoid business rule on sys_email, because we use emails extensively and already have few triggers; more of them may slow down this area.
I suppose there is a notification/email -something- that defines the other details than subject/body, but knowing fact that To: is calculated, From may be hardcoded.
Appreciate any help,
Thanks.
Pawel.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-16-2017 12:45 AM
Hi Pawel,
You can use mail scripts in the html body of the scheduled report so you can use the setFrom() and setReplyTo() methods to define the address the report comes from and is replied to.
Check out section 5 of the link below.
Scripting for Email Notifications - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-16-2017 12:45 AM
Hi Pawel,
You can use mail scripts in the html body of the scheduled report so you can use the setFrom() and setReplyTo() methods to define the address the report comes from and is replied to.
Check out section 5 of the link below.
Scripting for Email Notifications - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-16-2017 01:02 AM
I added to top of body
${mail_script:u_setFromScheduled}
and defined notification email script u_setFromScheduled with 'Script'
(function runMailScript(event) {
email.setFrom(ABC<abc@abc.com>');
})(current, template, email, email_action, event);
And ta-da all works fine.
Thanks David for quick turnaround.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-24-2019 05:07 PM
Hi Pawel
I would also like to do this can you please help me I am new to SN can you send me screen shot or steps please I would greatly appreciate it