Add User in CC of an email
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I have a requirement in my current project where I need to create an email script in ServiceNow. In the User table, I have three custom fields: L1 Approval, L2 Approval, and HR Employee. I need to include the users from these fields in the CC section of a notification. Could you please provide the email script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
what is the table of your notification. L1, L2 and FR will be based on some user for example requested for.
var ccEmails = current.requested_for.L1_approval +"," + current.requested_for.L2_approval + ","+ current.requested_for.hr_employee.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
and in CC we need to add L1 ,L2 and HR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Notification will be sent from which table? sn_hr_core*?
The code i suggested will work, just replace the variable and field names.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
@may13 , This is very simple.
Create a new mail script with any name.
Add a script in the mail script
email.addAddress("cc", current.requester.manager.email, current.requester.manager.name);Replace current.requester.manager.email with your fields name like - current.approval1, current.approval2.
Call the Script in Your Notification:
- Go to the notification (e.g., Incident [sys_notification]) you want to modify.
- In the What it will contain tab, find the Message HTML (or Plain Text) field.
- Add your email script as ${mail_script:your_email_script_name}
Follow this for more information - How to add CC in an email notification
If my response has helped you, kindly mark it as helpful and accept the solution.
Regards,
Nayan
