Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

How to send a single email to CC recipients for Group Approvals in ServiceNow?

Nikhil C
Tera Contributor

Hii all,

 

We have configured an email notification on the sysapproval_approver table to notify a group of users when an approval is requested. A CC recipient is also included in this notification.

When the notification is triggered, each member of the approval group receives an email. However, since the notification is sent once per approver record, the CC recipient also receives the same email multiple times. For example, if the approval group has 10 members, the CC recipient receives 10 separate emails for the same approval request.

What is the recommended way to prevent multiple emails to CC recipients and ensure that the CC user receives only a single notification for the group approval?

 

Thanking in advance.
Nikhil C

2 ACCEPTED SOLUTIONS

Vaibhav Chouhan
Tera Guru

This happens because notifications on the sysapproval_approver table are triggered per approver record, not per approval request.

To fix this, you should avoid sending the CC from the approver-level notification and instead send a single notification at the record level. Create a separate notification on the sysapproval_approver record.

View solution in original post

Tanushree Maiti
Kilo Patron

Hi @Nikhil C ,

 

 

Instead of relying on the CC field in the Notification form, you can create a mail script that ensures the CC recipient is added only once.

  1. Go to System Notification > Email > Notification Email Scripts.
  2. Create a new script .
  3. Add logic to include the CC email address as needed.

Sample Script:

(function runMailScript(current, template, email, email_action, event) {
var ccEmail = "manager@example.com";
email.addAddress("cc", ccEmail, "Manager Name");
})(current, template, email, email_action, event);
 
Remove the static CC in your notification definition and call the script in the message body using ${mail_script:add_cc_once}.
 
And just a note: If you have group email in sys_user_group  table, then 1 notification will go. If group email is empty, notification will go to each member of that group.
 
 

 

Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin:

View solution in original post

3 REPLIES 3

Vaibhav Chouhan
Tera Guru

This happens because notifications on the sysapproval_approver table are triggered per approver record, not per approval request.

To fix this, you should avoid sending the CC from the approver-level notification and instead send a single notification at the record level. Create a separate notification on the sysapproval_approver record.

@Vaibhav Chouhan  Could you please elaborate it in detail.

Tanushree Maiti
Kilo Patron

Hi @Nikhil C ,

 

 

Instead of relying on the CC field in the Notification form, you can create a mail script that ensures the CC recipient is added only once.

  1. Go to System Notification > Email > Notification Email Scripts.
  2. Create a new script .
  3. Add logic to include the CC email address as needed.

Sample Script:

(function runMailScript(current, template, email, email_action, event) {
var ccEmail = "manager@example.com";
email.addAddress("cc", ccEmail, "Manager Name");
})(current, template, email, email_action, event);
 
Remove the static CC in your notification definition and call the script in the message body using ${mail_script:add_cc_once}.
 
And just a note: If you have group email in sys_user_group  table, then 1 notification will go. If group email is empty, notification will go to each member of that group.
 
 

 

Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin: