Can we trigger email notification using client script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-23-2017 04:48 AM
Can we trigger email notification using client script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-23-2017 04:54 AM
Hi Deepali
I think client script only not possible instead of client script better to use the Glide AJAX mention gs.eventQueue(); in script include this will trigger the email notification

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-23-2017 04:54 AM
Create a script include with a function that triggers events using gs.eventQueue.
Call the script include using GlideAjax.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-23-2017 04:57 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-23-2017 05:11 AM
Hi Deepali,
You can't trigger email notification from client side scripts.
When you want the email to trigger? if it is onChange of some field then whenever you will write onChange client script on that field you will have to do GlideAjax and in the Script Include function use gs.eventQueue() method and pass necessary parameters.
As best practice have your GlideAjax as Asynchronous so that browser won't wait till the script include function returns something and email will get triggered in backend.
Examples of asynchronous GlideAjax
Events and Email Notification - ServiceNow Wiki
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader