Send a notification on Inbound email action

Jyoti36
Mega Expert

I have created an Inbound action on incident table.

Where, its matching the condition on incident, if the incident is found, then do the updates from inbound. This works fine.

Now, I just want to sent an email notification if the incident is not found. I was just wondering the following solution will work or not:

1. I am thinking of registering a new event and then using that in my else condition of the same inbound action,

2. which will then fire the notification. Is that going to work without any errors?

Please suggest if this is the best or do we have any other best option as well.

Thanks in advance!

Cheers!

23 REPLIES 23

Hi Jyo,


I,am trying to do the same on my instance. Fire an email notification from with inbound email script.


However, not sure what you mean by dummy object.


gs.eventQueue("sc_req.newhire.req.notsubmitted", current, email.body.location, email.body.hr_specialist_email);



Event is registered on sc_req_item table


Email notification is on sc_req_item table.



Event is getting logged but with error. It is trying to look for the record on sc_req_item table which never got created.



How did you fix this issue for your scenario?


Hi Jyo,



I have a very similar requirement.   Would you be willing to share your final inbound action script?



Thanks,



Robin


Hi Robin,



Yes sure!


Just use my code above and in the last else section use the below code:



else {


var grDummyInc = new GlideRecord('your_tablename');


grDummyInc.addActiveQuery();


grDummyInc.setLimit(1);


grDummyInc.query();


if(grDummyInc.next()){


        gs.eventQueue("your_event_name",grDummyInc,gs.getUserID(), gs.getUserName());


}


}




Hope it helps!!


Thanks


Jyo


A handy way to do it is to use the original email as the object to pass into the Notification Event.


autoResponseMail.jpg