Email Notification

AnanyaT
Tera Contributor

How to create scheduled email notification by scheduling as well by flow designer

 

1 REPLY 1

Community Alums
Not applicable

hi @AnanyaT ,

🕒 Option 1: Scheduled Email Using a Scheduled Job

If you want to send an email at a specific time (like every morning), you can do this with a scheduled script.

Steps:

  1. Create the email notification
    Go to System Notification > Email > Notifications, and set up your notification. Choose the table (like Incident), set the conditions, and define who should get the email.

  2. Create a scheduled job
    Go to System Definition > Scheduled Jobs > Scheduled Script Executions, and create a new one.
    Set the time you want it to run (e.g., daily at 8 AM).

  3. Write a script to trigger the notification
    In the job script, you can loop through records and trigger a custom event. Example:

     
var gr = new GlideRecord('incident');
gr.addQuery('active', true);
gr.query();
while (gr.next()) {
  gs.eventQueue('custom.incident.notify', gr, gr.sys_id, gs.getUserID());
}

4.Register the event
Go to System Policy > Events > Event Registry, and register custom.incident.notify.
Then link this event to your notification.

 

 

⚙️ Option 2: Scheduled Email Using Flow Designer

Steps:

  1. Create a new flow
    Go to Flow Designer, click New, and give it a name.

  2. Set the trigger
    Choose Scheduled as the trigger. You can set it to run daily, weekly, etc.

  3. Add an action to get records
    Use the Get Records action to pull the data you want (e.g., open incidents).

  4. Add an action to send email
    Use the Send Email action to send the notification. You can loop through the records or send a summary.