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.

using email address in Event Parm1 not working

jmcagod
Kilo Guru

Hi guys

I'm trying to create a bounce back notification to the user whenever they attempt to create a ticket via email.

On the existing Inbound Email, I triggered an event:

gs.eventQueue("create_ticket",current,email.origemail,"");

Parm1 - email address of the sender/requestor

Parm2 - empty, I just need one email.

The event perfectly works.

Going to notifications, I tried couple options to make it work:

1. Clicking Event Parm1 contains recipient. - did not work (Base on the forms that I read, you need   the user sys_id?)

2. Creating email script where:

       

        var requestor = even.parm1;

        email.setReplyto(requestor);

        var email_body = "This is a bounce back email notification";

        template.print(email_body);

        Still not working.

Am I missing something on the script? Can this be done using an event?

Thanks,

9 REPLIES 9

Hi,



I tried it, but its still not working.. not really sure whats wrong X((



cap1.PNG


cap2.PNG


As Abhinay said, if you can post a screenshot of System Logs > Events showing these events along with Parm1 and Parm2 columns, that would help a lot.


Abhinay Erra
Giga Sage

Problem here is not with the event parameter being sys_id or email id. Either way, it will work. See the event logs and see what the parms show


jmcagod
Kilo Guru

cap3.PNG


This is what I have


Since you are the person who needs to recieve the email. You need to check the send to event creator checkbox in order to send out the email. Open the email notification and check the send to event creator check box and test it again.