How to create a reminder email before 5min
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-08-2023 01:53 AM
Hi, there
I have created a custom table and have fields named "resevdate" and "resevtime".
I want to automatically send a reminder email 5 minutes before the date and time selected by the customer.
What's the best way to send reminder notifications to user..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-08-2023 02:50 AM
Hello @ying zeng
I will suggest you to create a schedule Job for sending the reminder emails. You can fetch the values from "resevdate" and "resevtime" fields and write the script to calculate the time and trigger your notification through gs.event
Here are some links you can refer
If my answer help you resolved your issue then mark it as solution accept or helpful.
Regards
Devender
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-12-2023 01:51 AM
I've created a System Scheduler but it doesn't work, can you check it for me pls?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-12-2023 04:33 AM
Hi @ying zeng
var gr = new GlideRecord('change_request');
gr.addQuery('first_field_date', gs.beginningOfToday());
gr.addQuery('hour_field', '08:00:00');
gr.query();
while(gr.next()) {
var gdt = new GlideDateTime(gr.getValue('first_field_date') +' '+gr.getValue('hour_field'));
gdt.addSeconds(-300);
var gdt1 = new GlideDateTime();
if(gdt.equals(gdt1)) {
gs.eventQueue("event_name", gr, "", "");
}
}
Please first try to capture the first_field_date value and hour_field value in logs and check if it is giving the expected values or not.
If my answer helps you to resolve your issue then hit correct or helpful.
Regards
Devender

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-12-2023 04:37 AM
Hi Ying,
Please refer the below threads may helpful to you.
ServiceNow Commnunity MVP -2018 class.