Add "To Address" through email script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2022 11:13 PM
Hello,
We have one global notification that will trigger to "requester" when any RITM is created on any catalog item. Here my requirment is, for one "XXX" catalog item if requester select one drop down variable as "ABC", we need to send out an email to one DL along with the requester.
I have created one email script & added in the global notification. But it is not showing in "To" address. However it is showing in CC or BCC
if (current.cat_item == 'a0b234d9dbf0941027fd10284b961920') {
var gr = new GlideRecord("sc_req_item");
gr.addQuery('sys_id', current.sys_id);
gr.query();
if (gr.next()) {
if (gr.variables.request_type == 'create' && gr.variables.data_object == 'GL Master') {
email.addAddress('To', 'XXX@gmail.com');
//email.addAddress('CC', 'XXX@gmail.com');
//email.addAddress('BCC', 'XXX@gmail.com');
}
}
How can we add in "TO" Adreess through email script.Please help here.
Thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2022 11:19 PM
Hi,
Refer to this thread :https://community.servicenow.com/community?id=community_question&sys_id=5a08a0acdbba545011762183ca96...
Mark my answer correct & Helpful, if Applicable.
Thanks,
Sandeep
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2022 11:19 PM
Hi n,
Make 'To' to 'TO'. Make O capital.
Mark helpful if it works.
Thank you
Gaurav Rotke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2022 11:21 PM
You can refer the below thread
https://community.servicenow.com/community?id=community_question&sys_id=5a08a0acdbba545011762183ca961947
