adding User email on CC with email script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2023 05:28 AM
Good Morning,
i have a reference field that is pointing to the sys_user table that will display a list of user informatiln. This field is Prepared By.
What i would like to do in an email script is to have who ever the user is listed in the Prepated By field to be "CC" on the email notification that is sent out.
The sys_user table has their email address listed.
What is the easiest way to do this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2023 06:16 AM
Notification is on which table
update as this
no need to use GlideRecord
1) does that user has valid email populated
2) is that user active and not locked out
3) is that user having notification preferences enabled in his/her profile
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2023 06:28 AM
yes to all and its dymanic as different users will be filling out the form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2023 12:49 PM
were you able to find a solution to this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2023 08:12 AM
no i am not able to find the solution to this
still needing it to work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2023 11:25 AM
Give this a try on your email script.
var user = new GlideRecord('sc_req_item');
user.get(current.document_id.sys_id);
if (user.isValidRecord()) {
email.addAddress("cc", user.variables.*your_variable*.email.toString(), user.variables.*your_variable*.getDisplayValue().toString());
}