Email notification not triggered

abirakundu23
Mega Sage

Hi All / @Ankur Bawiskar / @Anil Lande ,

As per requirement have to send a mail simultaneously when inbound email action is triggered. Inbound email action triggered but event-based notification is not triggered.

//Inbound Email action on table "sys_email".

var h_profile = new GlideRecord('sn_hr_core_profile');
    h_profile.addQuery('personal_email', email.origemail);
    h_profile.query();
    if (h_profile.next()) {
       
        if(h_profile.u_contractual_country == "IN"){
            gs.info("Inside true condition");
            gs.eventQueue('event name', current, email.origemail, '' );
        }
    }

Notification:

akundu23_0-1703571172760.pngakundu23_1-1703571218300.png

 

This event-based notification is not triggered. We received log about "Inside true condition".
Could you please guide me ? 

 

2 ACCEPTED SOLUTIONS

var ga = new GlideRecord('sn_hr_core_case');
if(ga.get('<sys_id of your case record>'))//pass sys_id of your case
{
gs.eventQueue('sn_hr_core.cmt.case.respond', ga, 'xyz.com','xyz.com');
}

 

Also, please make sure that the email you are passing in param1 and 2 should be a valid email.

View solution in original post

@abirakundu23 

//var h_profile = new GlideRecord('sn_hr_core_profile');
    //h_profile.addQuery('personal_email', email.origemail);
    //h_profile.query();
    //if (h_profile.next()) {
       
        //if(h_profile.u_contractual_country == "IN"){
            //gs.info("Inside true condition");
            gs.eventQueue('event name', current, '<put valid email id here>','<put valid email id here>' );
        //}
    //}

 

Replace your inbound script with the above script and replace <put valid email id here> with a valid email id and check if it triggers the notification.

View solution in original post

28 REPLIES 28

@abirakundu23 Good to know that the notification triggered. This indicates that there is an issue with your param1 or param 2 of your script.

 

Try updating your script as follows.

 

var h_profile = new GlideRecord('sn_hr_core_profile');
    h_profile.addQuery('personal_email', email.origemail);
    h_profile.query();
    if (h_profile.next()) {
       
        if(h_profile.u_contractual_country == "IN"){
            gs.info("Inside true condition");
            gs.eventQueue('event name', current, email.origemail+'', '' );
        }
    }

Please check if this change triggers the notification.

 

 

Hi @Sandeep Rajput ,

Not working, still notification not triggered.

 In event queue log state is showing error with latest triggered, when triggered fix script that time state was Processed.

akundu23_0-1703595741884.png

 

Can you please share your latest script?

 

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

@abirakundu23 

//var h_profile = new GlideRecord('sn_hr_core_profile');
    //h_profile.addQuery('personal_email', email.origemail);
    //h_profile.query();
    //if (h_profile.next()) {
       
        //if(h_profile.u_contractual_country == "IN"){
            //gs.info("Inside true condition");
            gs.eventQueue('event name', current, '<put valid email id here>','<put valid email id here>' );
        //}
    //}

 

Replace your inbound script with the above script and replace <put valid email id here> with a valid email id and check if it triggers the notification.

abirakundu23
Mega Sage

Hi @Sandeep Rajput ,

I tried that time event fired but notification not triggered.