External forwarding in scripts
In the following tutorial we would like to show you how a ticket, that has been generated by an incoming email can be forwarded without the need of a user dealing with it..
The following script fragment is anchored in the start-action of the relevant mailbox of todo4teams. This fragment performs the following:
- It will be checked whether one or more keywords occur in the subject of the incoming e-mail, in the present case this is "Plakataktion".
- If this is the case, the incoming message is forwarded directly to an external recipient, in this case "plakataktion@bergener-bluma.de".
- In the corresponding ticket in todo4teams the finishing remark will be set to "Externally forwarded!"
You can tailor this procedure exactly to your requirements, for help with the details please contact us at support@bergener-bluma.de by mail.
{
task.setDoneComment("Externally forwarded!");
var om = new com.proxemo.todo4.bom.ToDoOutgoingMail();
om.setTo("plakataktion@bergener-bluma.de");
om.setText("Action required");
var ts = new com.proxemo.todo4.bom.ToDoTaskShell(task);
ts.setOutgoingMail(om);
task = new com.proxemo.todo4.server.action.ToDoForwardExternalTaskAction().execute(-1, ts);
}
This action is usually started manually as described here "Manual External Forwarding".