Trigerring an email to ServiceNow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2024 03:02 AM
Hi,
Currently we are working on fetching the particular email from ServiceNow.
We have tried fetching through fix scripts and background scripts.But it was not triggering an email.
Can anyone suggest some ideas or particular code to execute the above scenario.
Regards,
Dhanush
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2024 03:12 AM
Okay let me brief it
Consider we have a request item to get new laptop
After submitting the request it is going for approval,Once the user or manager approves then email will be triggered.
Here we need to write some scripts to trigger the email after the approve,Now if I use the same script in background script or fix script,Whether it is going to trigger an email?
So we are looking for a script which needs to trigger an email which means whenever we run that script it automatically needs to trigger an email
So we have tested with the below code,But its not trigerring the email for mentioned recipients
var email = new GlideEmailOutbound();
email.setSubject('Incident Updated');
email.setBody('An incident has been updated.');
email.addRecipient(John.Doe@example.com); // Example: Send email to the caller email.send();
Can anyone help me on a script which triggers the email to particular recipient.