Creating an Event Handler
The following operations must be performed before creating an Event Handler:
- Creating an SMS gate for the SMS notification (see Managing SMS Gates);
- Adding a Notification Template for the required Event (see Creating a Notification Template).
The new created Event Handler is automatically created for all downline Resellers (see Delegating UI Templates, Notification Templates, Event Holders and Notification Categories).
To add an Event Handler:
- Sign in to the Operator Control Panel.
- On the Navigation Bar, click Settings > Notification > Event Handlers. The Workspace displays the List of Event Handlers (see Viewing the List of Event Handlers).
Click the Create button on the Toolbar.
Since the Event Handler is delegated to all downline Resellers it should be unique. That means that the set of Event, Notification template type, Notification template and Query parameters must not match the corresponding set of parameters of any other Event Handler of current Reseller (Operator) and all its downline Resellers.- In the Event list of the New Event Handlers page, select the type of event, for which the notification will be sent. The List of Event Handlers includes the following Events:
- In the Notification template type list, choose one of the following ways to send a notification message: SMS, Email or Client Panel.
- In the Notification template list, select a template that will be used to create a notification message (see Creating a Notification Template).
- In order to configure sending messages in the certain time:
- Clear the checkbox. The
- In the
In the Query field, type a request and condition of the handler. Use Placeholders if necessary (see Using Placeholders for Event Handlers).
The following operation with Placeholders are possible during the query creation:
>
<
>=
<=
=
!=
include? (for example, order.type = "SalesOrder" and (order.plans_ids include? 2000030)) - the Event Handler works if the Plan with id =2000030 is included in the Order)
- exclude? (to exclude the certain entities (using an id, key or name) from the massive of entities. For example, in order to exclude sending messages about an order creation, which includes the Plan with the id = 2000000, use the following rule: order.plans_ids exclude? 2000000)
and
- or
You can use the Liquid language, which allows creating more complicated Notification. For more information see https://shopify.github.io/liquid/basics/introduction/.
subscription.days_left = 10 AND subscription.status = "active" This query is used for all active Subscriptions that expire after 10 days.
- Click Create. New Event Handler will be created and displayed on the List of Event Handler of the current Reseller and all its downline Resellers (see Viewing the List of Event Handlers).