Creating email threads


 If you exchange multiple e-mails with customers for the same problem or topic on a regular basis, you may want to bundle this dialog into a single workflow.

E-mail programs such as Outlook or Thunderbird have a similar function, called the "grouped view": as long as both dialog partners use the "reply function" all messages are grouped together.
This is easy to set up in todo4teams when you specify the ticket ID in the subject line of the messages sent by todo4teams. You can do this by setting the value for the REPLY_SUBJECT_FORMAT key in the server settings. Re:% SUBJECT (ID:% TICKETID).

E-mail responses from todo4teams will always receive the subject as Re :, followed by the subject of the sent message e.g. (ID: 423123) as a reference to the ticket to this e-mail.
If the customer replies to your response e-mail, todo4teams can connect this new e-mail with his first e-mail, if he has used the reply function of his e-mail program and the reference via the subject remains.

The following piece of script code creates this ticket reference and groups the tickets to a common workflow:

function ticketExists (subject)
{
   var idarr = helper.extractByRegExp(subject.toLowerCase(),"\\(id: (\\d.+?)\\)",false);
   var id=-1;
   if (idarr != null && idarr.length>0)
    {
        id = java.lang.Long.parseLong(idarr[0]);
        println ("ID"+id);
       var qm =  new com.proxemo.todo.bom.ToDoArchiveQueryMap(1);
        qm.addNameValue(com.proxemo.todo.bom.ToDoArchiveQueryMap.ID_ATTRIBUTE, id);
       var qresult = new com.proxemo.todo.server.action.ToDoQueryArchiveAction().execute(-1, qm);
        println("number of results"+qresult.getTasks().size());
       if (qresult.getTasks().size()>0)
        {
            task.setMaster(qresult.getTasks().get(0));
           return true;
        }
    }
   return false;   
}

var isFollowUpTicket = ticketExists(message.getSubject());

The script extracts the ticket ID from the subject line of the incoming e-mail and starts an archive search for the original ticket. If this is found, both tickets are grouped into a workflow using the call task.setMaster (parentTask).

In the ticket details you can then simply display the e-mail dialog with the customer in the workflow tab:

Bildschirmfoto vom 2016-12-07 13-52-49.png

The script function shown above has another benefit: You can use the variable stored in the isFollowUpTicket variable to decide whether you want to send the customer an automatic e-mail reply.Within In long e.mail dialogs it is hardly useful to confirm the receipt of each of their e-mails to the customer. It is sufficient to do this within the first e-mail, so if isFollowUpTicket == false.

You can also compare in this case the described procedure with the function history with which you can display all e-mails from the same senders e-mail address!

     

Child Pages