How to add the user in TO of the email notification?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2023 06:02 AM
Hi Team,
I have created the notification based on the record insert and update but add in user TO list we will push the email id based on the user ID .The user ID is string field in custom table.
We need to take the user ID and query to the user table how to achieve this please suggest
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2023 06:20 AM
Hi @sri83 You can refer to https://tech.forums.softwareag.com/t/servicenow-email-notification/237436
Please mark it helpful if it helps...
Thanks,
Sonia
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2023 06:40 AM
the only way is to trigger email notification based on event
Use after insert/update BR and trigger the event.
Ensure you give correct BR conditions
I hope you know how to create event, how to link notification with event
Use this script in BR
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var gr = new GlideRecord("sys_user");
gr.addQuery("user_name", current.u_user_id);
gr.query();
if (gr.next()) {
gs.eventQueue('event_name', current, gr.email.toString());
}
})(current, previous);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2023 02:37 AM
Thank you for marking my response as helpful.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader