Examples

The following examples show simple possibilities in trigger files.

1st example (STATUS_CHANGE=trigger_status_change.txt)

If a ticket gets the self-defined status "Release to test" (status 220), then an automatic mail template "Release to test.html" should be sent to the customer (email address of the ticket originator).

function checkData(table, out){
	var wert = table.get("status");
	if (wert.equals("220")){
		table.put("templatename","Freigabe-zum-Test.html");
	}
}
 
function getStatus(){
	return [220];
}

For control purposes, you could first have the mails sent to your own mail address. To do this, insert a line so that the function then has the following appearance:

	if (wert.equals("220")){
		table.put("templatename","Freigabe-zum-Test.html");
		table.put("e-mail empfaenger","test.user@testfirma.de"); // <-- Hier wird die eigene Adresse gesetzt
	}

2nd example (MAIL_OUT=trigger_mail_out.txt)

If an i-net HelpDesk user who belongs to the user group "VIP" sends a new request by mail, then the mail template file "VIP_Antwort.html" is to be used in deviation from the standard auto-answer mail.

function checkData(table, out){
	if(table.get("benutzergruppe").equals("VIP")){
		if(table.get("typdescription").equals("IMAP new Order")){
			table.put("templatename","VIP_Antwort.html");
		}
	}
}