- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2025 10:41 PM
Dear experts,
I want to know how do we use this condition for an email notification when to send is When Triggered, I configured an email notification for monthly KRI Email Reminder and scripted a scheduled job script which is as below but it is not triggering the email to send. Any approach or missing steps I need to do?
// Create a GlideNotification object
var notif = new GlideNotification();
// Specify the notification name (use the sys_id or the name of the notification)
notif.setNotification('KRI Email reminder');
// Optionally, specify a target record for the notification (null if not needed)
var targetRecord = null; // You can specify a record, or leave it as null
// Send the notification
notif.send(targetRecord);
// Log that the email was triggered
gs.log('KRI Reminder email sent successfully on the 24th', 'KRI Reminder');
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2025 11:08 PM
Hi @ChuanYanF ,
Triggered type notifications are used in the flows.
In this scenario, if you want to use a scheduled job, create an event and fire the event. Then, update the notification's "Send When" setting to "Event is fired" and select the newly created event.
Alternatively, you can use the flow and utilize the "Send Notification" action, ensuring the notification type is set to "Triggered."
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2025 11:09 PM
Ok @ChuanYanF
Apologies, you are talking about when "When to Send is Triggered" in the notification form itself.
That triggered is used when its "TRIGGERED BY ACTION IN FLOW DESGINER"
Refer this documentation -
Hope this answers your query, that's not for scheduled job. In scheduled job you will need "gs.eventQueue()" - as I had replied in my previous reply.
Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket.
Regards,
Shivalika
My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194
My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2025 11:13 PM
Hello @ChuanYanF ,
Please note that GlideNotification is meant for showing a notification on the user's screen, it's not meant for email notification.
Here are the steps for triggering an email notification from a script:
Step 1: go to System Policy > Events > Registry and create a new event, e.g. "kri.reminder"
Step 2: configure your Notification like this (but select your own "kri.reminder" event here):
Step 3: in your Scheduled Script, add this line. Note: "gr" is the GlideRecord of the record that this notification is about. If it's not about a record you can replace it with null.
gs.eventQueue('kri.reminder', gr);
Regards,
Robert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2025 10:58 PM
Hello @ChuanYanF
You need to create an event.
use this format in the scheduled job - gs.eventQueue('event_name', current, parm1, parm2) - params is whatever you pass in the data from your scheduled job if you want to pass any.
Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket.
Regards,
Shivalika
My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194
My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2025 11:08 PM
Hi @ChuanYanF ,
Triggered type notifications are used in the flows.
In this scenario, if you want to use a scheduled job, create an event and fire the event. Then, update the notification's "Send When" setting to "Event is fired" and select the newly created event.
Alternatively, you can use the flow and utilize the "Send Notification" action, ensuring the notification type is set to "Triggered."
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2025 11:09 PM
Ok @ChuanYanF
Apologies, you are talking about when "When to Send is Triggered" in the notification form itself.
That triggered is used when its "TRIGGERED BY ACTION IN FLOW DESGINER"
Refer this documentation -
Hope this answers your query, that's not for scheduled job. In scheduled job you will need "gs.eventQueue()" - as I had replied in my previous reply.
Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket.
Regards,
Shivalika
My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194
My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2025 11:13 PM
Hello @ChuanYanF ,
Please note that GlideNotification is meant for showing a notification on the user's screen, it's not meant for email notification.
Here are the steps for triggering an email notification from a script:
Step 1: go to System Policy > Events > Registry and create a new event, e.g. "kri.reminder"
Step 2: configure your Notification like this (but select your own "kri.reminder" event here):
Step 3: in your Scheduled Script, add this line. Note: "gr" is the GlideRecord of the record that this notification is about. If it's not about a record you can replace it with null.
gs.eventQueue('kri.reminder', gr);
Regards,
Robert