Creating an event handler
The following operations must be performed before creating an event handler, create a notification template for the required event (see Creating a notification template). For SMS notifications, also create an SMS gate (see Managing SMS gates). The newly created event handler is automatically delegated to all downstream resellers (see Delegating UI templates, notification templates, event handlers, and notification categories).
In this article:
Creating an event handler
To add an event handler:
- Go to Event Handlers (see Navigation). The list of event handlers is displayed (see Viewing the list of event handlers).
Click Create. The New Notification Event Handlers page is displayed.
Since the event handler is delegated to all downstream resellers, it must be unique. That means that the set of the event, notification template type, notification template, and query parameters must differ from any other event handler of the current reseller and all its downstream resellers.In the Event list, select the event for the notification. For the full list of events, see the table below.
- In the Notification template type list, select 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).
- To configure sending messages at a certain time:
- Clear the checkbox. The
- In the
In the Query field, enter the request and condition of the event handler. Use placeholders if necessary (see Using placeholders for event handlers).
The following operations with placeholders are available for the query:
>
<
>=
<=
=
!=
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 certain entities (using an id, key, or name) from the massive of entities. For example, to exclude sending messages about the order creation for a plan with the id = 2000000, use the following rule:
order.plans_ids exclude? 2000000
) and
- or. For several
or
afterand
, use additional parentheses:order.type = "RenewalOrder" and order.renewal_is_positive = true and subscription.payment_model = "prepay" and ((order.plans_ids include? 293827) or (order.plans_ids include? 293824) or (order.plans_ids include? 294340))
- % (for example, 30% of the financial blocking threshold:
account.financial_blocking_threshold % 30
)
You can use the Liquid language to create complicated notifications. For more information see https://shopify.github.io/liquid/basics/introduction/.
- Click Create. The new event handler will be created and displayed in the list of event handlers of the current reseller and all its downstream resellers (see Viewing the list of event handlers).
List of events
Event | Description |
---|---|
Account credit hold is coming | Occurs when the account balance becomes equal to or less than the defined part (1~99%) of the financial blocking threshold but not less than the financial blocking threshold. Requires the proper Query. |
Account changed | Occurs when an account is moved to the administrative or credit hold (see Moving an account to the administrative hold and Moving an account to the credit hold) or when an account is returned from the administrative or credit hold (see Returning an account from administrative hold). |
Account created | Occurs when a new account was created (see Creating an account). |
Financial blocking threshold was changed | Occurs when the financial blocking threshold was set for a new account (see Creating an account) or changed in an account class (see Viewing and updating account class details) or at the account level (see Viewing and updating account's details). When an account gets another account class but the value of the financial blocking threshold is not changed, the event does not occur. |
Account manager changed | Occurs when an account manager was set or changed (see Viewing and updating account's details). |
Correction approved | Occurs when a manager approves a correction via the Operator Control Panel (see Approving a correction) or API (see Update a Reseller's Correction status). Optionally, the manager ID can be specified as the Query. A notification is sent to the account Owner's email. |
Invoice closed | Occurs on the billing day, when an invoice is generated (see Managing invoices). It is also used for manual sending an invoice to an email (see Resending an invoice) |
The Invoice was approved | It is triggered by approving a postpaid Invoice with external management (see Managing invoices for the Postpay model by a third-party ERP system). The invoice.has_attached placeholder is used to define whether a third-party invoice is attached to the linked payment. |
Low balance | Occurs when the account balance is negative. |
Manager created | Occurs when a new manager is created via the Operator Control Panel (see Adding a manager) or API (see Create a Reseller's Manager). Used for sending the credentials to the manager (see Placeholders used in notification templates for specific event handlers). Requires no Query. |
Manual operation | Occurs when:
|
Payment has been received | Occurs when the payment changes its status:
|
Payment due date is coming | Occurs only for subscriptions within the Postpay model. Depending on the conditions specified in the Query (see Using placeholders for event handlers), it occurs the specified number of days prior to the end of the payment expiration period (see Viewing and updating account class details), or on the payment due date, when the payment receives the Expired status, and the related subscriptions are blocked (see Viewing details of the invoice for the Postpay charging model). If no conditions are specified in Query, the event occurs on the payment due date. An email notification includes a PDF invoice attached. The PDF invoice is generated for a payment linked to a postpaid Invoice in the platform. The PDF invoice is generated for accounts that have as the default payment method an active payment method based on the CheckCash plugin only (see Viewing and updating account type's details). |
Postpay payment created | Occurs on the day after the billing day, when the platform closes a postpaid Invoice and creates the related payment. An email notification includes an attached PDF invoice for the postpaid payment. The PDF invoice is generated for accounts that have as the default payment method an active payment method based on the CheckCash plugin only (see Viewing and updating account type's details). |
Password reset request | Occurs when an email with instructions on how to reset the user's password for the Customer Control Panel is requested (see Resetting the password to the Customer Control Panel). |
Manager password reset request | Occurs when an email with instructions on how to reset the manager's password for the Operator Control Panel is requested (see Resetting a forgotten manager's password). |
Before subscription expiration | Occurs daily for all the subscriptions that are not linked to renewal orders in the Waiting for provisioning or Provisioning statuses. Requires the proper configuration of the Query field. |
After subscription expiration | Occurs daily for all the subscriptions. Requires the configuration of the Query field. |
After subscription switched from trial to no-trial | Occurs when a subscription is switched from a trial to a paid period. |
Subscription changed | Occurs when:
|
Verify email | Occurs when a new user completes the registration process in the Customer Control Panel by clicking the Sign Up button (see Short registration). |
User invitation | Occurs when an external user is invited by the account Administrator or Owner (see Inviting External Users). |
Order changed | Occurs when the order status changes to:
The receipt is not attached to a notification. |
Order created | Occurs when a new order is created (Creating an order) including manual and automatic renewing of a subscription. To avoid sending to customers invoices to pay for prolong orders created on the billing day for automatic paying from the account balance, see Prolonging a subscription), it is necessary to exclude subscriptions with Auto-renew point (days) = 0 from the Order created and Order changed events. To do that, for these events, in the Query field, use the following expression: |
Guaranteed payment created | Occurs when:
|
Guaranteed payment changed | Occurs when a guaranteed payment is revoked manually or automatically because of the balance top-up (see Manually revoking a guaranteed payment). |
Guaranteed payment will expire | Occurs in the specified number of days before the expiration date of a guaranteed payment. |
Days left to pay | Occurs daily for all the subscriptions. Requires the configuration of the Query field. |
Phone verification | Occurs after clicking the Receive a verification code button at the SMS Verification step during the full registration of an account (see Full registration). |
Billing day is coming | Occurs on a daily basis for each unique billing day. This event is used to inform the account Owner by email about the sum that is required at the account balance on the billing day in order to prevent the subscriptions from stopping. If an account has a subscription with the Pay as you go billing type, the notification contains the information that the required sum may change (see Pay as you go. Charges generation). The email additionally contains the link to the Top-up Balance page (see Balance topping up). Managers authorized in the Operator Control Panel with the System administrator and Sales person roles (see Managers' roles) can also follow the link and log in to the Customer Control Panel within the same reseller if they do not have another session in their browser with authorization in the Customer Control Panel. Subscriptions in the following statuses only (see Viewing the list of subscriptions) are taken into account by the event handler:
This event handler requires the setting of the Query. To make a table with subscriptions that are about to expire, use the following placeholders:
|
Billing day for manager's subscriptions has come (former Billing day has come) | Occurs after running the billing process and closing charges for every manager in the following cases:
On the New Notification Template page, in the Additional Settings group, in the To field, enter the |
Billing day for account's subscription has come | Occurs after running the billing process and closing charges for every account if all of the following conditions are satisfied:
The event occurs independently for every subscription of an account. On the New Notification Template page, in the Additional Settings group, in the To field, it is possible to use the For the event, a particular preformatted notification template with data per resource category can be used for Microsoft Azure Plan and Microsoft Azure subscriptions: |
Net cost has been changed | Occurs when the net cost has been changed at the current reseller level (see Viewing the price list). Leave the Query field empty when creating this event handler. The platform collects information about net cost changing once per 24 hours at night. Only the plans, for which the net cost has been changed from 00:00:00 to 23:59:59 on the previous day, are included. For example, if the information is collected at 2:00 a.m. on July, 30, only the plans for which the net cost has been changed from 00:00:00 to 23:59:59 on July, 29, are included. |
Credit limit for postpaid subscription was changed | Occurs for accounts with postpaid subscriptions that are not deleted in the following cases:
The event occurs for changes via API and the Operator Control Panel. |
Credit limit for postpaid subscription is approaching | Occurs when the current debt becomes greater than the defined part (1~99%) of the subscription credit limit but still less than the subscription credit limit. Requires the proper Query. Occurs only once. |
Closing documents generated | It is triggered by an API method (see Send notifications on Closing documents). The event is used for sending notifications to accounts of a reseller on closing documents for the selected period. The closing documents are available for downloading via the link in the notification and viewing in the Customer Control Panel (see Managing Closing documents). The Closing documents section of the Customer Control Panel is displayed for an account if the corresponding system settings are applied (see General system settings). Notifications are sent on closing documents in the New status only. After notifications are set, the closing documents get the Sent status. |
Joined payment created | Occurs when payments have been joined automatically or manually to the joined payment (see Joining payments for the Prepay model). |
Resend the order | Occurs in the specified number of days after the day when the order was created for orders in the Waiting for payment status and payments linked to one order only (the payments are not joined, see Joining payments for the Prepay model). |
Resend the joined payment | Occurs in the specified number of days after the day when the joined payment was created. For payments in the Waiting for payment status only. |
Request to reset the password after the user creation | Occurs when the user's password has been reset, in the case when the user was created in the Operator Control Panel (see Creating a user). |
Update CSP net costs | Occurs daily for all the subscriptions. Requires the configuration of the Query field. |
Upload CSP net costs | Occurs when:
|
Request for creating bill was sent | Occurs if the manual operation for receipt generating was created. |
Bill on balance replenishment is ready | Occurs if the receipt for balance top-up was created manually. |
The accounting period was closed | Occurs when 1C sends a request to ActivePlatform to reconcile the account balance in 1C and ActivePlatform to close the accounting period. |
VSP resources changed | Occurs when a subscription to a plan received from Vendor Portal changes its status from Updating to Active, after the quantity of subscription resources was changed. |
VSP subscription created | Occurs when a subscription to a plan received from Vendor Portal changes its status from Installing to Active (see also Synchronization of products and plans between Vendor Portal and ActivePlatform). |
Create instance | Occurs when a new CloudServer server is created (see Создание Сервера). |
Reset instance password | When a password for a CloudServer server is reset. Password reset is possible only using the user interface of the CloudServer control panel. |
Data processing for Azure Plan subscriptions completed | Occurs for the Microsoft CSP Products plugin on the level of the reseller with the Office365 plugin integration settings and application template. Occurs after processing the detailed resource consumption data for all Microsoft Azure Plan subscriptions of a reseller in two days after closing the invoices. The Query for an event handler should not be specified. As the recipient, only an existing email of a manager can be specified without any placeholders. See also Configuring notifications for the Microsoft Azure Plan service. |
Spending budget for a period is approaching | If an account set the spending budget notification threshold for a subscription with the Pay as you go billing type, the event occurs when the subscription consumption (the total amount of charges in the Blocked status) for the selected period reached or exceeded the threshold, but remains less than the budget. The query for an event handler is not required. The current version of the platform does not support setting the spending budget and notification threshold, so the event is not used and never occurs. |
Spending budget has been reached | If an account set the spending budget for a subscription with the Pay as you go billing type, the event occurs when the subscription consumption (the total amount of charges in the Blocked status) for the selected period reached or exceeded the budget. The query for an event handler is not required. The current version of the platform does not support setting the spending budget and notification threshold, so the event is not used and never occurs. |