Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Email notifications not appearing in outbox as expected from Exercise 31: Test email notifications

ryanwarren
Giga Contributor

I have followed the previous tutorials as well as included many gs.debug statements to try and figure out why the expected events in this exercise are not showing up in the outbox.

Here is a direct link to the business rule "Marketing Event Events" on my dev instance that should be kicking off these email events: https://dev10418.service-now.com/nav_to.do?uri=sys_script.do?sys_id=edbf56630fe4d600699a4e9ce1050e9f

The username is: admin

The password is: password

Here are a few data points and troubleshooting steps I have tried:

1. The tutorial Module 9: Events and notifications, Exercise 28: Create another event business rule shows the script as a non-self executing function, it is simply:

function onAfter() {

        // inner code

}

When I place debugger statements inside this function and trigger the script to run, the debugger statements do not appear in the debugger section of the window.

In order to get the statements to show up in the debugger window (and by proxy show me that the script was actually run), I need to convert it to a self executing function:

(function onAfter(current, previous) {

        // inner code

}(current, previous));

Is it correct to assume that changing this to a self-executing function is okay to do here (even though the tutorial does not show it as such)?

Even after making it a self executing function, the email notification is fired successfully and my debug statements show up but the email never appears in the system outbox.

2. I am viewing the outbox as the sysadmin

3. I have tried viewing the outbox as another account in case the event was filtered by who sent it. No go here.

4. I have specified the email to be sent to "current.event_coordinator.email" instead of the tutorial suggested "current.event_coordinator"

5. My instance is Geneva

6. In the email notifications for "at_capacity" and "over_capacity", "send to event creator" is checked.

Thanks!

Ryan

EDIT:

To clarify, the admin emails from Module 9: Events and Notifications, Exercise 30: Create email notifications for "Marketing Event is at capacity" or "Marketing Event is over capacity" are not showing up for existing Marketing Events.

Message was edited by: Ryan Warren - Added an item to the data points list - Added a clarifying question about changing the onAfter function from a regular function to a self-executing function - Added clarifying statement about which e-mails are not showing up

1 ACCEPTED SOLUTION

ryanwarren As it happens, I forwarded this issue to the documentation team earlier today from a different person having trouble. You used Beth Anglin as the event coordinator as suggested in Exercise 21. However, that user has Notifications disabled. If you either pick a different user as coordinator or turn her notifications on, you should then see messages in the outbox.


View solution in original post

8 REPLIES 8

jnguy1
ServiceNow Employee
ServiceNow Employee

Hi Ryan,



I'm looking at your instance and I see messages showing up in the outbox for the marketing event app. Are you still having issues?



Thanks.


Jack


Hi Jack,



I see the one from the Marketing Event "Test". That's great! Any idea why a new marketing event would send notifications correctly while the existing ones (e.g. Dallas LUG) would not? What troubleshooting steps can I take in the future to better understand this issue (teach a man to fish)?



Thanks!


Ryan


Not sure why it happen ,updates are also generating event but it takes some delay in your instance to process it.I see notifications for updates as well.


I should note that e-mails were already being sent when an attendee was added to a marketing event. The admin emails from Module 9: Events and Notifications, Exercise 30: Create email notifications for "Marketing Event is at capacity" or "Marketing Event is over capacity" were NOT sent when the event was at capacity and over capacity.



I see that creating a new marketing event and testing the exercise 30 admin emails does work. However, if this were a client's production instance, I don't think it would be practical to recreate existing marketing events. The issue lies somewhere after the event is triggered and the email system receives the email and sends it. How do I troubleshoot why the emails are not created and placed in the outbox for existing marketing events?



Here are the steps i'm using to test the admin e-mails:


1. Navigate to Marketing Event > Marketing Events.


2. Find the Dallas LUG row and double click the Attendees registered cell and change the value to 3 (if not already). Max capacity should read 4 and Attendees registered should read 3.


3. Goto Marketing Event > Attendees.


4. Ensure there are 3 users set to attend the Dallas LUG event. If there are less than 3, create random users in the Attendees table and assign them to the Dallas LUG event until there are three. If there are four or more, delete any users that are attending the Dallas LUG event until there are three.


5. We will now try to kick off the "event is at capacity" admin email. Still on the Marketing Event > Attendees table view, click NEW.


6. Fill out the form, keeping in mind there are required fields, and assign that user to the Dallas LUG event.


7. Click SUBMIT


8. Navigate to Marketing Event > Marketing Events


9. The Attendees registered value for the Dallas LUG row should now be 4. Max capacity and Attendees registered should now be equal.


8. Navigate to System Mailboxes > Outbound > Outbox


9. Observe that the outbox does not list an email for "Marketing event Dallas LUG has reached capacity". There is one for the "Thank you for registering for Dallas LUG" message but that is not where we're looking for.