how can i add watch list users to cc in the email notifications
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2018 06:42 AM
hello friends,
i am trying to send the email notifications to the cc ie the user from the watch list.Could you please help me out
please provide with details as i am new to scripting.
Thanks,
venkat
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2018 05:49 AM
Hi Nana,
tq for your response It didn't work

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2018 04:38 AM
Hi venkyyy,
navigate ->Notification Email script(Under system notification): write down bellow code.
name: Add_watchlistUser_toCC.
if (!current.watch_list.nil()) {
var watcherIds = current.watch_list.split(","); //get watch list addresses and add to cc
var user = new GlideRecord("sys_user"); //get user records
user.addQuery("sys_id", watcherIds);
user.addQuery("notification", 2); //email
user.addQuery("email", "!=", "");
user.query();
while (user.next()) {
email.addAddress("cc", user.email, user.getDisplayValue()); //add to cc list
}
}
then navigate -> notification(s) of choice ->Under the 'what it contains' tab
under the message HTMl add the below code:
${mail_script: Add_watchlistUser_toCC}. //put your notification email script name here.
just for note: do not use any blank spaces between words while giving name to the email script. and also do not put any symbol before $.
Regards,
Ashvini.k
Kindly Hit Helpful, Reply,Mark as Correct Answer if you found useful
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2018 06:49 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2018 12:23 AM
Hey do this way, because <mail_script> tag is not working in notification mail script so i created one template and convert this to mail script, and call it in notification.
go to navigation navigate
System policy -> email->template -> new -> in that message HTML write down previous script under <mail_script> your code here </mail_script>
while saving form it will ask you this. select yes. it will auto convert your template to email notification script.
and your template will show like this . copy that name
and search that name in notification email script you will get there.
now go to the system notification -> notification ->new -> under when to send checked insert and update check boxes. and under what it will contain select template there which you have created. and save form.
try it and let me know if have any doubts.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2018 03:24 AM
hello, it didn't fetch me result.
thanks for giving responses quickly.