Send email notification to different users based on a particular condition?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2022 02:26 AM
Hi All,
I have a requirement where I need to trigger a single record created notification(i.e. for a record created through record producer via portal) to different users, depending on what the current instance is, i.e. DEV, UAT or PROD.
For example, if the record is created in DEV instance, send to user A; if the instance is UAT, send notification to user B; if instance is Production, send to User C.
Thanks in advance!
- Labels:
-
Notifications

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2022 02:31 AM
Hello. Please go through this thread.
In short, you must create a notification email script, where you will check the instance name (here it is described how to get the name). Then based on the result, set different values of the recipient.
Please Mark Correct and Helpful if my answer helps you resolve your issue. Thanks!
Martin Ivanov
Community Rising Star 2022
Please mark Correct and click the Thumb up if my answer helps you resolve your issue. Thanks!
Martin Ivanov
ServiceNow MVP 2023, 2024
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2022 04:16 AM
Hi Martin,
Thanks for the prompt reply.
I have created a notification email script wherein I have checked the instance as per below :
var instance = gs.getProperty("instance_name");
if(instance == "demoDEV") // DEV
However I need a bit of help as to how to assign recipient as per instance, as per eventQueue function. Could you please help guide how to proceed? Many thanks.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-28-2022 05:08 AM
Hello!
Notifications in sysevent_email_action?
You can create one notification per instance and use the Advanced Condition field in sysevent_email_action to trigger according to gs.getProperty("instance_name");
Philippe

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2022 05:10 AM
Hi. If my answer has helped you resolve your issue, Please mark Correct and Helpful. This way, other users may also benefit from the thread. Thanks!
Martin Ivanov
Community Rising Star 2022
Please mark Correct and click the Thumb up if my answer helps you resolve your issue. Thanks!
Martin Ivanov
ServiceNow MVP 2023, 2024