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:

  1. Go to Event Handlers (see Navigation). The list of event handlers is displayed (see Viewing the list of event handlers).
  2. 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.
  3. In the Event list, select the event for the notification. For the full list of events, see the table below.

  4. In the Notification template type list, select one of the following ways to send a notification message: SMS, Email, or Client Panel.
  5. In the Notification template list, select a template that will be used to create a notification message (see Creating a notification template).
  6. To configure sending messages at a certain time:
    1. Clear the checkbox. The 
    2. In the
  7. 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 after and, 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/.

    This query is used for all active subscriptions that expire after 10 days:

    subscription.days_left = 10 AND subscription.status = "active" 
  8. 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

EventDescription
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.

For example, the account credit hold is coming event will occur when the account balance becomes less than 35% of the financial blocking threshold:

account.financial_blocking_threshold % 35 < -account.balance

Account changedOccurs 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 createdOccurs when a new account was created (see Creating an account).
Financial blocking threshold was changedOccurs 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 changedOccurs when an account manager was set or changed (see Viewing and updating account's details).
Correction approvedOccurs 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 closedOccurs 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 approvedIt 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 balanceOccurs when the account balance is negative.
Manager createdOccurs 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 operationOccurs when:
Payment has been receivedOccurs when the payment changes its status:
  • To Cancelled (see Approving a payment).
  • From Waiting for payment to Completed.
  • From Waiting for payment to Invoice creation.
  • From Invoice creation to Receipt sent.
  • From Receipt sent to Completed.
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.

To send notifications several days prior to the payment due date, use the following condition in Query:

payment.days_left = N

where N is the number of days prior to the end of the payment expiration period.

To send notifications on the payment due date, when the payment gets the Expired status, and the related subscriptions are blocked, use the following condition in Query:

payment.days_left = 0

or leave Query empty.

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 createdOccurs 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 requestOccurs 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 requestOccurs 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 expirationOccurs 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 expirationOccurs daily for all the subscriptions. Requires the configuration of the Query field.
After subscription switched from trial to no-trialOccurs when a subscription is switched from a trial to a paid period.
Subscription changedOccurs when:
  • The subscription status is changed to:
    • Active.
    • Deleted, excluding the case of automatic or manual deletion of a subscription with Ordered status.
    • Stopped (excluding the case of the administrative hold of the account).
    • Delivered.
    • Graced.
    • Stopping failed.
    • Installation failed.
    • Activation failed.
    • Renewing failed.
    • Updating failed.
  • A subscription is switched from a trial to a paid period.
  • An active subscription is renewed in the Operator Control Panel (see Manual renewing of a subscription) or in the Customer Control Panel (see Renewing a Subscription).
  • A subscription is auto-renewed (see Auto-renewing a subscription).
  • The quantity of additional resources is changed (see Upgrading or downgrading a subscription).
Verify emailOccurs 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 changedOccurs 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: order.type = "ProlongOrder" AND order.renewal_is_positive = true. As a result, the events will occur for subscriptions with Auto-renew point (days) > 0 only.

Guaranteed payment createdOccurs when:
Guaranteed payment changedOccurs when a guaranteed payment is revoked manually or automatically because of the balance top-up (see Manually revoking a guaranteed payment).
Guaranteed payment will expireOccurs in the specified number of days before the expiration date of a guaranteed payment.
Days left to payOccurs daily for all the subscriptions. Requires the configuration of the Query field.
Phone verificationOccurs 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:

  • Active.

  • Graced.

  • Waiting for manual approve for stopping.

This event handler requires the setting of the Query.

If the query is not set, then the event handler is triggered in every possible situation.

For example, if an account has three subscriptions with any billing type with three different billing days, the account Owner will receive three email notifications a day.

To avoid this situation, it is strongly recommended to set the following parameters (see Using placeholders for event handlers):

  • Existence of the subscriptions with the determined payment model. You can set this parameter using the subscription.payment_model placeholder:

    • If subscription.payment_model = "postpay", the notification is sent for postpaid subscriptions only.
    • If subscription.payment_model = "prepay", the notification is sent for prepaid subscriptions only.
  • Existence of the subscriptions with the determined billing types. You can set this parameter using the monthly_billing placeholder. To send notifications only to the Owners of the accounts that have the subscriptions with monthly billing types, add the following expression in the Query field:

    monthly_billing = "true"
  • The number of days left to the billing day that caused the notification event to occur. You can set this parameter by using the billing_day_left placeholder. To send notifications a defined amount of days prior to each unique billing day, add the following expression in the Query field:

    billing_day_left = {amount of days prior to each unique billing day}

You can additionally set the following parameters:

  • The date of the billing day. You can set this parameter by using the billing_day placeholder.
  • The total amount of charges in the Open status that will be closed or blocked on the billing day that caused the notification event to occur. Only subscriptions with Auto-renew point (days) = 0 are included. If there are no open charges, preliminary generation of the charges for the next billing period is used for calculation. You can set this parameter by using the billing_day_open_charges_amount placeholder.
  • The IDs of the plans of the account active subscriptions. You can set this parameter by using the plan_ids placeholder.
  • The IDs of the products of the account active subscriptions. You can set this parameter by using the product_ids placeholder.
  • The account type key. You can set this parameter by using the account.type_key placeholder.
  • The account class key. You can set this parameter by using the account.class_key placeholder.
  • The available account balance. You can set this parameter by using the account.balance placeholder.
  • The financial blocking threshold. You can set this parameter by using the account.financial_blocking_threshold placeholder.

For example:

billing_day = 1 and billing_day_left = 28 and account.type_key = "personal" and account.class_key = "default" and account.financial_blocking_threshold = 0 and monthly_billing = true and (plan_ids include? 1420) and (product_ids include? 498)

If you want to add several conditions that should be fulfilled simultaneously, use the and operator: billing_day = 1 and billing_day_left = 28. In this case, a notification is sent 28 days prior to the billing day only for the subscriptions with the billing day set on the 1st day of each month. In total, one notification a month is sent to each unique account Owner.

If you want to add several conditions, only one of which should be fulfilled at a time, use the or operator: billing_day = 1 or billing_day = 5. In this example, one notification for each subscription with the unique billing day is sent each day of the billing period for subscriptions, if the billing day is set on the 1st or the 5th day of each month. In total, two notifications a day are sent to each unique account Owner.

Use parentheses () to group and to combine conditions: (billing_day = 1 or billing_day = 2) and (billing_day_left = 3 or billing_day_left = 4). In this case:

  • One notification is sent 23 days prior to the billing day for the subscriptions with the billing day set on 1st day of each month.
  • One notification is sent 24 days prior to the billing day for the subscriptions with the billing day set on 1st day of each month.
  • One notification is sent 23 days prior to the billing day for the subscriptions with the billing day set on 2nd day of each month.
  • One notification is sent 24 days prior to the billing day for the subscriptions with the billing day set on 2nd day of each month.

In total, 4 notifications a month are sent to each unique account Owner.

Also, you can use math operators + and -, comparison operators > <, or invert a placeholder and its value (1 = billing_day).

To make a table with subscriptions that are about to expire, use the following placeholders:

  • next_billing_period_start_day — the first day of the next billing period with reference to the billing day triggered the event.
  • next_billing_period_end_day — the last day of the next billing period with reference to the billing day triggered the event.
  • Placeholders for the subscription entity (see Placeholders for the Subscription entity).
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:

  1. A manager has at least one account with a subscription in any status except Deleted, and the subscription billing day is the day of running the billing process.
  2. The conditions specified in the Query field are satisfied.

On the New Notification Template page, in the Additional Settings group, in the To field, enter the {{manager.email}} placeholder to send a notification to the proper manager email.

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:

  1. An account has at least one subscription with the billing day equal to the day of running the billing process.
  2. This subscription has charges in the Closed status for the previous billing period.
  3. The amount of any of these charges is greater than 0.
  4. The conditions specified in the Query field 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 {{owner.email}} placeholder to send a notification to the Owner of an account.

For the event, a particular preformatted notification template with data per resource category can be used for Microsoft Azure Plan and Microsoft Azure subscriptions:

The notification template supports displaying the following information:

  1. Spend Dynamics:
    1. Costs for the last completed billing period (up to 11 digits) with the reseller currency units.
    2. Year and month of the last completed billing period.
    3. Costs for the second-to-last completed billing period (up to 11 digits) with the reseller currency units.
    4. Year and month of the second-to-last completed billing period.
    5. Percentage of the growth rate calculated as follows:

      ( (Last Billing period - Second-to-last Billing period) / Second-to-last Billing period ) × 100

      The red color is used for positive growth rate, green — for a negative one, grey — for zero growth rate.

    6. The Spend Dynamics block is not displayed if there is no data for the last or second-to-last completed billing periods.
  2. Cost structure in the past billing period:
    1. Line chart:
      1. Every part of the chart represents a resource category consumed in the last completed billing period.
      2. Every part of the chart has its color.
      3. The chart parts are sorted from most to least.
      4. The maximum number of the parts is 5. Other resource categories are grouped and displayed as others.
    2. Legend:
      1. The legend displays the part names and their percentage.
      2. The maximum number of the parts is 3.
      3. The part names are sorted from most to least.
      4. Next to the part names, their colors used in the chart are displayed.
    3. Table:
      1. The table includes the following columns:
        1. The part colors used in the chart.
        2. Resource category.
        3. Cost, <the reseller currency units> — the quantity of the resource category consumed in the last completed billing period.
      2. The rows are sorted by cost, from most to least.
  3. Last month weekly cost dynamic — bar chart:
    1. Every part of a bar represents a resource category consumed in the last completed billing period.
    2. The maximum number of the parts is 5. Other resource categories are grouped and displayed as others.
    3. The part colors match the line chart.
    4. Hight of a bar represents the amount of the resource category consumed weekly in the last completed billing period.
  4. Explore more analytics — link to the Analytics page in the Customer Control Panel (see -Subscription analytics) for a subscription triggered the event, with the predefined filters:
    1. Granularity — daily or monthly.
    2. Period — depending on the granularity:
      • Daily — current or previous billing period.
      • Monthly — 3, 6, or 12 billing periods.

All costs are displayed in accordance with the reseller currency settings (see Currencies). The names of months are displayed in the default language of the Operator Control Panel (see Managing language settings), and the rest of the text is specified manually.

Example viewExample code
<!-- CHART_COLORS = %w(#5c4aa7 #d4e689 #94db99 #bd8c75 #5e4ca9 #db577d) --> <!-- SHOULD BE MAPPED IN CORE FOR SORTED BY 'percent_usage' for last_billing_period --> <table width="100%" bgcolor="#ffffff"> <tr> <td height="30"></td> </tr> <tr> <td> <table width="640" cellpadding="0" cellspacing="0" align="center" bgcolor="#ffffff" style=""> <!-- BODY --> <tr> <td align="left" colspan="3" valign="top" width='580' style="padding: 0 30px;"> <table> <tr> <td> <p style="margin:0;padding:0;"> <font color="#333333" face="Arial, sans-serif" style="font-size: 20px;"> <br>Hello, {{owner.first_name}} {{owner.last_name}}! </font> <br> <br> <font color="#333333" face="Arial, sans-serif" style="font-size: 14px;"> The expenses of the company <strong> # {{account.id}} "{{account.name}}" </strong> for the subscription <strong> # {{subscription.id}} "{{subscription.name}}" </strong> in the past billing period (from {{subscription.last_billing_period_start_day}} to {{subscription.last_billing_period_end_day}}) were <strong>{{ subscription.last_billing_period_amount_with_currency }}</strong> </font> </p> </td> </tr> </table> </td> </tr> <tr> <td height="24"></td> </tr> {% if subscription.last_billing_period_amount > 0 and subscription.pre_last_billing_period_amount > 0 %} <tr> <td align="left" colspan="3" valign="center" width='580' style="padding: 0 30px;"> <table> <tr> <td height="12"></td> </tr> <tr> <td> <p style="font: 16px Arial, sans-serif; color: #333333; line-height: 22px; margin: 0 0 0px 0;"> <strong>Spend Dynamics</strong> <br /> <br /> </p> </td> </tr> <tr> <td align="center" valign="center" width='190' style='border-right: 2px solid; border-right-color: #f1f1f1;'> <p style="font: 16px Arial, sans-serif; color: #333333; line-height: 2px; margin: 0 0 0px 0; font-weight: bold;"> <br>{{ subscription.pre_last_billing_period_amount_with_currency }} <br /> </p> <p style="font: 14px Arial, sans-serif; color: #808080; line-height: 22px; margin: 0 0 0px 0;"> <br>{{subscription.pre_last_billing_period_month}} {{subscription.pre_last_billing_period_year}} <br> </p> </td> <td align="center" valign="center" width='190' style='border-right: 2px solid; border-right-color: #f1f1f1;'> <p style="font: 16px Arial, sans-serif; color: #333333; line-height: 2px; margin: 0 0 0px 0; font-weight: bold;"> <br>{{ subscription.last_billing_period_amount_with_currency }} <br /> </p> <p style="font: 14px Arial, sans-serif; color: #808080; line-height: 22px; margin: 0 0 0px 0;"> <br>{{subscription.last_billing_period_month}} {{subscription.last_billing_period_year}} <br> </p> </td> <td align="center" valign="center" width='190'> {% if subscription.change_in_periods > 0 %} <p style="font: 16px Arial, sans-serif; color: red; line-height: 2px; margin: 0 0 0px 0; font-weight: bold;"> <br>+{{subscription.change_in_periods}}% <br> {% elsif subscription.change_in_periods < 0 %} <p style="font: 16px Arial, sans-serif; color: green; line-height: 2px; margin: 0 0 0px 0; font-weight: bold;"> <br>{{subscription.change_in_periods}}% {% else %} <p style="font: 16px Arial, sans-serif; color: grey; line-height: 2px; margin: 0 0 0px 0; font-weight: bold;"> <br>{{subscription.change_in_periods}}% {% endif %} </p> <p style="font: 14px Arial, sans-serif; color: #808080; line-height: 22px; margin: 0 0 0px 0;"> <br><br> </p> </td> </tr> </table> </td> </tr> {% endif %} <tr> <td align="left" valign="top" width='580' style="padding: 0 30px;"> <table> <tr> <td height="12"></td> </tr> <tr> <td> <p style="font: 16px Arial, sans-serif; color: #333333; line-height: 22px; margin: 0 0 0px 0;"> <br><strong>Cost Structure in {{subscription.last_billing_period_month}} by resource category</strong> <br /> <br /> </p> </td> </tr> <tr> <td align="left" valign="top" width='640'> <table> <tr> {% assign counter = 0 %} {% for item in subscription.resource_categories %} {% if counter < 3 %} {% assign counter = counter | plus:1 %} <td align="left" valign="center" width='15' height='15' style="background-color: {{item['chart_color']}}; border-radius: 1px;"> </td> <td>&nbsp;&nbsp;</td> <td align="left" valign="center" height='15'> <p style="font: 12px Arial, sans-serif; color: #555555; line-height: 15px; margin: 0;"> {{ item['name'] }} {{ item['percent_usage'] }}% </p> </td> <td>&nbsp;&nbsp;</td> {% endif %} {% endfor %} </tr> </table> </td> </tr> <tr> <td height="12"></td> </tr> <tr> <td align="left" valign="top" width='640'> <table> <tr> {% for item in subscription.resource_categories %} <td align="center" valign="center" width="{{ item['percent_usage'] | times: 630 | divided_by: 100 }}" height='25' style="background-color: {{item['chart_color']}}; border-radius: 1px;">&nbsp;</td> {% endfor %} </tr> </table> </td> </tr> <tr> <td align="center" colspan="6" valign="center" width='640'> <table> <tr> <td height="24"></td> </tr> <tr> <td width='20' height='20' style='background-color: none;'> </td> <td valign="center" width='300' style='padding-left: 20px;'> <p style="font: 16px Arial, sans-serif; color: #808080; line-height: 2px;"> <br>RESOURCE CATEGORY <br /> </p> </td> <td valign="center" width='300'> <p style="font: 16px Arial, sans-serif; color: #808080; line-height: 2px;"> <br>COST, {{reseller.currency}} <br /> <br> </p> </td> <br> </tr> <br> <tr><td><br></td></tr> {% for item in subscription.resource_categories %} <tr> <td align="left" valign="center" width='15' height='15' style="background-color: {{item['chart_color']}}; border-radius: 1px;"> </td> <td valign="center" width='300' style='padding-left: 20px;'> <p style="font: 14px Arial, sans-serif; color: #333333; line-height: 2px;"> <br>{{ item['name'] }} <br /> </p> </td> <td valign="center" width='300'> <p style="font: 14px Arial, sans-serif; color: #333333; line-height: 2px;"> <br>{{ item['total_for_current_billing_period'] }} <br /> </p> </td> </tr> <tr> <td height="8"></td> </tr> {% endfor %} </table> </td> </tr> <tr> </tr> </table> </td> </tr> <tr> <td align="left" valign="top" width='580' style="padding: 0 30px;"> <table> <tr> <td height="12"></td> </tr> <tr> <td> <p style="font: 16px Arial, sans-serif; color: #333333; line-height: 22px; margin: 0 0 0px 0;"> <br><strong>Last month weekly cost dynamic</strong> <br /> <br /> </p> </td> </tr> <!-- max_totals_sum_weekly decorated_steps ['200K', '190K', '180K' .. '20K', '10K'] (max and first el == decorated max_totals_sum_weekly), size == 10 resources_total_by_weeks [['3 Feb. - 9 Feb.', [[46000, '#5c4aa7'], [15000,'#d4e689'], ... ]], ...]] --> <!-- maybe refactor this.... --> <tr> <td align="center" colspan="7" valign="center" width='640' height='280'> <table border="0" cellpadding="0" cellspacing="0" role="presentation" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt;"> <tr> <td style="vertical-align:bottom; border-right: 2px solid #ebebeb;"> <table border="0" cellpadding="0" cellspacing="0" role="presentation" style="border: none; border-collapse: collapse; mso-table-lspace:0pt; mso-table-rspace:0pt; width:20px;"> {% for step in subscription.decorated_steps %} <tr> <td style="height: 28; font: 12px Arial, sans-serif; color: #808080;" align="center">{{step}}</td> </tr> {% endfor %} </table> </td> {% for item in subscription.resources_total_by_weeks %} <td style="padding: 0 16px; vertical-align:bottom;"> <table border="0" cellpadding="0" cellspacing="0" role="presentation" style="border: none; border-collapse: collapse; mso-table-lspace:0pt; mso-table-rspace:0pt; width:80px;"> {% for totals in item['totals'] %} <tr> <td style="height: {{ totals['total'] | times: 140 | divided_by: subscription.max_totals_sum_weekly }}px; background-color: {{totals['chart_color']}};"></td> </tr> {% endfor %} </table> </td> {% endfor %} </tr> <tr style='border-top: 2px solid #ebebeb;'> <td align="center" valign="center"> </td> {% for item in subscription.resources_total_by_weeks %} <td align="center" valign="center"> <p style="font: 12px Arial, sans-serif; color: #808080; line-height: 14px;"> <br>{{ item['week'] }} <br /> </p> </td> {% endfor %} </tr> </table> </td> </tr> <tr> </tr> </table> </td> </tr> <tr> <td height="24"></td> </tr> <td> <table> <tr> <p style="font: 14px Arial, sans-serif; font-color: #333333; line-height: 22px; margin: 12px 0; text-align: center;"> <a style="display: inline-block;" href="https://{{domain}}/subscriptions/{{subscription.id}}/analytic"> <span style="display: inline-block; color: #ffffff; background-color: rgb(22, 155, 213); padding: 12px 60px; border-radius: 5px;"> EXPLORE MORE ANALYTICS </span> </a> </p> </tr> </table> </td> </tr> <tr> <td colspan="3" align="center" valign="top" height="30"></td> </tr>
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.

For example, the Credit limit for a postpaid subscription is approaching event will occur when the current debt for a postpaid subscription becomes greater than 70% of the subscription credit limit:

subscription_postpay.credit_limit % 70 < subscription_postpay.current_debt

Closing documents generatedIt 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 createdOccurs when payments have been joined automatically or manually to the joined payment (see Joining payments for the Prepay model).
Resend the orderOccurs 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 paymentOccurs 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 creationOccurs 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 costsOccurs daily for all the subscriptions. Requires the configuration of the Query field.
Upload CSP net costsOccurs when:
Request for creating bill was sentOccurs if the manual operation for receipt generating was created.
Bill on balance replenishment is readyOccurs if the receipt for balance top-up was created manually.
The accounting period was closedOccurs when 1C sends a request to ActivePlatform to reconcile the account balance in 1C and ActivePlatform to close the accounting period.
VSP resources changedOccurs 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 createdOccurs 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 instanceOccurs when a new CloudServer server is created (see Создание Сервера).
Reset instance passwordWhen 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 completedOccurs 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.