Email notification are not sending when an event is trigger

appsicumdisplay
Mega Contributor

Hii All,

        I search a lot about email notification but I don't get any satisfied answer. Many questions don't have any answer and some have suggest that "Checked field(Send to event creator) in Email Notification. I did the same but email are not sending please help me out.

I want to send an email using a event when a condition is met in business rule. My situation is following.

  • Event: exceed_proposed_time
    • Fired by: After new time record redirection
  • Email Notification: Exceed Proposed Time
    • Send to event creator = checked
  • Business Rule: After new time record redirection
    • insert = checked
    • update = checked
    • Script: gs.eventQueue('exceed_proposed_time', current, current.sys_id, "myemail@example.com");

Business rule have met condition: I checked and showing a error message

Event is created: I checked in System Logs -> Events

Email is not sending: Checked my inbox and ServiceNow's "System Mailbox -> outbound -> outbox".

Please let me know where I'm wrong or you need more information.

Thanks-

Macarius

1 ACCEPTED SOLUTION

Hi Macarius,



Nice, now we definitely know what the problem is. Now it's a matter of pinpointing what's causing it. I think there is no shortcut here then just go through those steps:


Diagnosing and remedying stuck event processes



You can also try to log in to your affected nodes and do it yourself:


How do I log into a specific node or cancel a job on a node I'm not logged into?



or just contact SNow and they will be able to do it for you.




Cheers



Greg


View solution in original post

28 REPLIES 28

Thanks Tony for your investigation,


        I want to let you know that in my scenario, I have some Users(access level wise) and when end-user(or any other leveled user) exceed the limit of proposed time then System Administration should received a email notification about the same.



Suppose that I have sys_id of System Administration = "123456" and email = "myemail@example.com".



So please let me know that what is the values of EventParam1 and EventParam2 ?


Parm1 and Parm2 are populated by the call to gs.eventQueue


Parm1 = current.sys_id


Parm2 = "myemail@example.com


gs.eventQueue('exceed_proposed_time', current, current.sys_id, "myemail@example.com");




specifying the actual email address is not useful in this context.


the notification requires the sys_id of the record in the sys_user table


Tony,


        I did the same. Even I tried to pass sys_id of Admin in Param2 but didn't find any clue.



Note:   My Event state = "ready" every time.



I checked this in wiki



3. eventQueue(String, Object, String, String, String)

Queues an event for the event manager.


3.1.1 Input Fields

Parameters:


  • Name of the event being queued.
  • A GlideRecord object, such as "current".
  • An optional parameter, saved with the instance if specified.
  • A second optional parameter, saved with the instance if specified.
  • An event queue to add the event to.

3.1.2 Example


if (current.operation() != 'insert' && current.comments.changes()) { gs.eventQueue("incident.commented", current, gs.getUserID(), gs.getUserName()); }



Is there any other thing which we are missing?


Or there is any other option to send email notification?


If the Event state = "ready" then probably you have a problem processing events in general.