- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-29-2015 07:59 AM
I have a send button , by clicking the send button an email should be sent to some people. I've already set up an email notification , an event, and a business rule. But my question is that how do I trigger the event with my UI action button ( send)?
Solved! Go to Solution.
- 18,667 Views

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-29-2015 09:28 AM
Only if you are using the parameters as recipients should you choose to check these.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-06-2017 11:03 AM
Robert,
I have been trying to create that "Send Test Email" button and have not been able to get the script to work. I would appreciate any assistance that you could provide. Below is my script.
var email = 'marshall.day@yahoo.com';
gs.eventQueue('sendNotification', current, email);
I have asked this question in the Developer Community and have not received any successful information.
Marshall
Send Test Email Button: Is there any out there?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-06-2017 12:41 PM
Lets start with some basics:
- Is "sendNotification" an event in your registry?
- Is the notification you're expecting to fire adequately configured to fire on event and listing the sendNotification event?
- Is the notification properly configured as "parm 2 contains recipient"? (since you're sending it in the second parameter?)
- Is the notification set to "Send to event creator = false"?
Is there anything in the email log?
RDF
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-06-2017 01:10 PM
Robert,
Thank you for responding. Let me first say that I am new to SNOW and am building my understanding and ability with each passing day. Your questions may not be answered completely or I may need greater clarification.
1.sendNotification is not an event in my registry. I can create it if need be.
2. The notification is any current notification in SNOW. I know that email notifications are filled with historical info when displaying in Preview mode and I just want to "Send" that email as a test to verify how it looks in different email clients (Outlook, gMail, Firefox, etc.).
3. Uknown. I created a UI Action "Send Test Email" button on the Incident table and am trying to configure the script to make it work (if possible). I will create similar buttons for each table with notifications.
4. Send to event creator = false
5. Nothing in email log.
Your questions bring up questions of my own. Do I need to build a BR to simply have a test email sent from the Email Notifications>(Notification of Choice)? Is there no way to force a test email from the Email Notification page without creating an INC/CHG/REQ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-06-2017 04:43 PM
Hey Marshall,
(1) is super important. You've basically told SN "fire this event", but given it an event that does not exist.
(2) You're not going to be able to test "any" notification in ServiceNow this way. The explanation is long, but basically...
- notifications can be fired three ways: via events, via their own defined logic, or via embedded workflow activities. "gs.eventQueue" is only useful for launching notifications... specifically those that are told to trigger off the event you're instantiating with gs.eventQueue.
(3) The UI action isn't what I'm asking about here. When you launch an event with gs.eventQueue you can also pass parameters. Since SN designed notifications with intent of being triggered by events, when you configure a Notification record there should be two checkboxes: Event 1 Contains recipient and Event 2 Contains recipient.
(4) If "Send to Event Creator" is false then you *must* ensure that the target email address is not the same as the address associated with the user you're logged in as. The intent of that flag is to stop notifications from firing where the recipient would already know... such as assignment notifications. Its the number one reason for failed tests.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2017 11:17 AM
Robert,
Thank you for taking the time to clarify the issue I was trying to create. One would think that Service-Now would have a built in ability to artificially send notifications for testing purposes, especially when you are dealing with large companies that may have hundreds of email templates created. Since there is no method or manner in which to create my Send Test Email procedure, I will put it to rest in a nice peaceful area of my yard and plant some roses on it.
I greatly appreciate the help.
Marshall Day