Need notifications when replies are sent to a case.

brandon_bakowsk
Tera Contributor

Whenever a client replies to a case generated via Email to ticket, I need a notification sent out to the assignee of that case so we don't miss any sort of information, just like how SN notifies us whenever a new comment is added.

I've been plugging away at this via inbound actions and notifications all day and have about hit my limit, I've seen similar posts about such an issue but was hoping someone had an easy solution I just haven't thought of yet.

Is there any easy solution to be notified on "Email received"?

28 REPLIES 28

You are correct, I just have it set to assigned to.

Ok lets try this then. Move it above current.update() and change the code to.

gs.eventQueue('case.email.received', current, email.body_text);

Then in the email body you can do ${event.parm1} to display the email.body_text in the notification.

You're talking about changing the script in the notification correct? Just wanna be certain.

First part where we are talking about gs.eventQueue, I want you to update that in the inbound action. Where I'm saying to put ${event.parm1} that goes into the message html section of the what will it contain tab in the notification.

Moved it in the inbound action "update case via reply" to now be this like you said:

//if case.state = resloved (6), then check first word in body for accept or reject
//else if case.state = Awaiting (18), then, move to open state
var case_state = current.state;
if (current.state == 6) {
    var lines = email.body_text.split('\n');
    var firstword = "";
    if (lines.length > 0)
        firstword = lines[0].replace(/^\s+|\s+$/g,'');
    firstline = firstword.toLowerCase();
    if (firstline) {
        if(firstline.indexOf("reject") == 0)
            current.state = 10;
        else if(firstline.indexOf("accept") == 0)
            current.state = 3;
    }
} else if (current.state == 18) {
    current.state = 10;
} else{
    current.sys_updated_on = "";
}
gs.eventQueue('case.email.received', current, email.body_text);
current.update();


Still nothing unfortunately.