Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Email notifications

SingL
Tera Contributor

I have configured few email notifications to trigger after request got fulfilled. This is triggering based upon the variable choices user selects. 

Now I want to send emails to few users who are in the list collector variable. So they will receive confirmation emails once the request got fulfilled. 

i am

trying to implement using email script but it’s only pulling them in cc but not in To field. 

 

experts please help. Thank you!

 

 

3 REPLIES 3

Its_Azar
Mega Sage

Hi there @SingL 

 

If you want to send the notification to the users in the list collector, don't rely on the To field UI — list collector values don't automatically populate there.  else just select the variable in Recipients fields which holds list collector , in your notification, go to Recipients → Advanced and use 

(function() {
    var users = [];
    var listValues = current.variables.your_list_collector_variable; // sys_ids

    if (listValues) {
        listValues.split(',').forEach(function(id) {
            users.push(id);
        });
    }

    return users;
})();

This will send the email directly to those sys_ids as primary recipients, not CC.

☑️ If this helped, please mark it as Helpful or Accept Solution so others can find the answer too.

Kind Regards,
Azar
Serivenow Rising Star
Developer @ KPMG.

SingL
Tera Contributor

I used debugging to check in the email logs and it displayed all the users email to whoever I have given. But that did not show those users in the To or recipient field of email logs. So should I confirm that it still works as per your comment? 

SingL
Tera Contributor

I tried it did not work. Can you please help me on this?