Notifications: a step by step example
This chapter explains, step by step, how to configure a notification in order to send an email when a User Request is assigned to an agent. The notification will be sent to the “Agent” to which the ticket has just been assigned.
Go to the “Admin tools / Notifications” page, in the “Triggers” tab click on the “Create a new Trigger” link (if there are no triggers already) or click on the “New…” button to create a new Trigger.
Create a Trigger
When prompted about the type of Trigger to create, select “Trigger (on entering state)”:
Click apply to pick this type of Trigger, and when prompted fill the fields as follows:
|Description||Trigger when a Request is assigned|
|Target class||User Request|
|Filter||Leave this field empty.|
Then click Create.
Create an Email Action
Click again on the “Notifications” menu, but this time switch to the “Actions” tab and click “New…” to create a new Email Action. Fill the fields as follows:
|Name||Notification to the agent|
|From||put a valid email address otherwise your mail server may reject the email|
|To||SELECT Person WHERE id = :this->agent_id|
|Subject||The ticket $this->ref$ has been assigned to you|
The ticket $this->name()$ has been assigned to you. Title: $this->title$ Description: $this->description$ $this->head_html(ticket_log)$ for more information on this ticket, click here: $this->hyperlink()$
Link the Trigger to the Email Action
Then switch to the “Related Triggers” tab and relate this notification to the trigger you've just created:
And click “Create”.