Send E-mail based on the Date/time selected in a field.

Mark263
Kilo Contributor

All,

I have a field on the incident form

Name : 'Next Email'

Type - Date/Time

An E-mail should be sent as per the date and time selected in that field.

Is this possible.? If yes, Kindly help

1 ACCEPTED SOLUTION

Mark,

eventQueueScheduled works to trigger an email on a particular date and time. Only when Next email is updated from empty to a new value, it triggers an event to be processed at the specified date and time.

https://docs.servicenow.com/bundle/jakarta-platform-administration/page/integrate/email-integrations...

I am not sure what is not working for you. 

View solution in original post

25 REPLIES 25

Hi

the above answer is not working

Kindly help

Archana Reddy2
Tera Guru

Hi Mark,

If you want the email to be sent when an incident is getting created/updated, follow the below:

Navigate to System Notifications --> Email --> Notifications

Create a notification as:

---------------------------------------------------------------------------

Check Inserted/Updated as per your requirement.

-----------------------------------------------------------------------------------------------

Select the users who need to receive this email. 

---------------------------------------------------------------------------------------------------

Provide the subject and body of the email in What it will contain tab.

For more information, follow https://docs.servicenow.com/bundle/jakarta-servicenow-platform/page/administer/notification/concept/c_EmailNotifications.html

Mark the answer as Helpful if you find so.

Thanks,

Chappidi Archana

If you want to trigger the notification even when the record is not inserted/updated, you have to create an event. Email triggers when this event gets fired.

Hi Archana,

The above mentioned method is working. However, it's sending an E-mail as soon as the form is updated.

My requirement is to send email at the selected time in the field.

Could this be done?

TIA

Yes, it can be done by using Scheduled Jobs.

Use the below script in Scheduled Job:

var gr = new GlideRecord('name_of_your_table');

gr.addQuery('u_next_email',new GlideDateTime());

gr.query();

if(gr.next())

{

gs.eventQueue('event_name',gr,gs.getUser());

}

You will have options to select when to Run this schedule Job in the Scheduled Jobs.

The above script sends the email to the logged in user and you will have to create a new event(event_name in this case).

Hope this helps.

Mark the answer as Correct/Helpful based on its impact.

Thanks,

Chappidi Archana