At the bottom of the trigger settings you will find the Add action button. Triggers are used to automate the sending of notifications, e-mails, SMS messages, and the setting of tasks according to pre-specified rules.
Multiple actions can be created within one trigger. The compatibility table lists which actions are allowed for which events.
Let's take a closer look at a few actions.
Send email with template
When you select the "Send email with template" option, the "Template" field appears, where you need to select the email template that will be sent when the trigger is executed. Please note that the trigger event must be "Sending email when order is changed".
Below the template selection, a notification is displayed stating that it is possible to check if the customer is unsubscribed from the mailing list by means of a Twig expression. The expression itself is presented in the same notification as a hint. If the customer is unsubscribed from the mailing list, they will not be sent an email
Note
The code suggested in the tooltip depends on the object available for the selected trigger event.
Send SMS with template
With the "Send SMS with template" option, you need to follow the same process as the "Send email by template" option previously mentioned. Please note that the trigger event must be "Sending SMS when order is changed".
Send message to chat with template
Important!
This action is only available with the WhatsApp Business integration with active templates].
If you select the "Send message to chat with template" option, the "Template" field will appear, where you must select a message template that will be sent to the customer when the trigger is executed.
If the message fails to be sent to the chat, the system can automatically send the customer an SMS. To do this, fill in the "SMS template" field in the selected chat template.
Please note that after sending the template, the dialogue will not be automatically created. The dialogue is created only after the customer replies to the template message.
Set task
This action allows you to assign a task to a specific manager. When creating an action, first select a responsible manager, then add text and comments to the task, and select the time during which the manager will receive the reminder.
Make HTTP request
This action is used to transfer information from the system to an external service or to initiate the execution of an external script. Please note that the trigger only sends the request. The response to the request is not processed by the trigger.
Call to customer
Please note that in order to perform this action, you must have an active telephony system (this action does not work with such telephonies as "Prostie Zvonki" (Simple Calls) and "OnlinePBX").
The "Call to customer" action allows you to initiate a call for the responsible or specific manager. The responsible manager is selected in the "User to whom the call is made" option.
The phone number to be called is taken from the customer or order card, depending on the selected event in the trigger itself. If you select "Order change"- the phone number is taken from the order, and if you select "Change of customer information" - the phone number is taken from the customer card.
If a corporate customer is selected, the phone number is taken from the contact person bound to the order.
Add cost
Please note that this action is available only if the "Order change" event is selected.
In the condition, specify on what the trigger will be executed. In our example, the trigger will be executed on order creation.
After specifying the condition, select the cost item that will be created by the trigger, and the sum. In our example, this is an employee bonus for the amoutn of £100
It is also possible to use expressions in the "Sum" field. For example, the expression order.totalSumm * 0.01
is used to calculate a manager bonus depending on the sum of the order.
Note
The sum is specified as a number without adding a currency. The currency is set automatically based on the default one in the system. In the "Date" field, you can specify the date when the cost item was created. If no date is specified, then the date when the trigger was executed will be used by default.
You can also use expressions in the "Date" field. For example, the date in the cost item can be "bound" to the order creation date by calling order.createdAt
call or "bound" to another date in the order.
In the "User" field, you can specify which manager will appear in the cost item.
In the comment it is possible to use objects available in the trigger filter. Only text is allowed here, not html.
Clicking on the title of the article will open the editing window.
Builder for actions to change a field
For the actions "change order data" and "change customer data" the system has a visual constructor available that allows you to customize the action without the need for technical knowledge.
Note
In the constructor, it is possible to work with the fields of type: "Number", "String", "Dictionary" and "flag(Yes/No)”. For unusual cases, use the editor.
Let's consider the editor functions that are available when setting up the action.
"Change" option: It replaces the value of the selected field with another value of the same field (in the case of directories or checkboxes (Yes/No)), or with an arbitrary value (in the case of text/numeric fields).
"Take from another field" option: It replaces the value of the selected field with the value of another field. When selecting the "Change order" event it is possible to access the fields of both the order form and the customer assigned to the order.
"Clear field" option: It leaves empty the selected field (with a null ) after the execution of the trigger.
Below we show an example of an update of the order´s data based on customer data:
Event: Order change
Condition: Changed the order field from any to any (in our case we selected the “customer comment” field)
Action: Change the custom field in the “customer comment” order.
Another example is when you need to assign a specific manager when an order arrives with the desired payment method or order type:
Event: Order Change
Condition: New Order AND Order Type = Private individual
Action: Change the "Order Manager" field to the desired value.
Useful links:
For more information on how to work with finances, see the related article.
For information on how to create a template for an email, see the "E-mail templates" section.
For information on how to create a template for an SMS message, see the section “SMS templates”.
For information on how to create a notification template, see the section "Creating a notification template".