How to Send Email Notification from Fix Script or Scheduled Job (GlideEmailOutbound Not Working)

raj12345
Tera Contributor

Hi Community,

Task - Integrate ServiceNow to Greenhouse -
Use case 1 - Create the user weekly base - Person X should get a mail success or fail 
Use case 2 - Update the user weekly base -Person X should get a mail success or fail 


I'm working on a ServiceNow automation where I update user data in Greenhouse via API from a Fix Script and a Scheduled Job.

After the script runs, I want to send a summary email notification (e.g., success/failure counts, runtime info). I tried using the following approach:

var email = new GlideEmailOutbound();
email.setSubject("Greenhouse Sync Result");
email.setBody("Sync completed.");
email.setFrom("no-reply@mydomain.com");
email.addRecipient("me@example.com");
email.save();
But the email never sends, and I realized GlideEmailOutbound is not supported for this use case.

So now Instead of this How we can get the solution.
Please assist me in this
Ward Regards,


1 REPLY 1

Chaitanya ILCR
Kilo Patron

Hi @raj12345 ,

 

1. Create a script include in global scope and use it in your fix script

ChaitanyaILCR_1-1747741035119.png

ChaitanyaILCR_2-1747741100481.png

 

 

2. create a notification and fire an event to trigger the notification

3. see if flow suits your requirement and use send email action in the flow

 

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya