how can i add watch list users to cc in the email notifications

venkyyy
Kilo Contributor

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

 

20 REPLIES 20

Please try using below script:

var watchListArray = current.watch_list.split(',');
    watchListArray.forEach(function(watcher) {
        var user = new GlideRecord("sys_user");
        user.get(watcher);

        email.addAddress('cc',user.email.toString(),user.name.toString());
    });

venkyyy
Kilo Contributor

find_real_file.pngthese are the screenshots ...please rectify my mistake 

Can you post a screen shot of the mailscript you've configured as well?

First thing to note is that you shouldn't use spaces in your mail script names, if you've called it 'Add users from watchlist for cc' you should rename it 'add_users_from_watchlist_for_cc' and rename it in the call on the notification: ${mail_script:add_users_from_watchlist_for_cc}

venkyyy
Kilo Contributor

tq for rectifying,  i have done want Ashvini Kadus  as stated as clicked the pics too. But it didnt help me .

please help me