Helper function parameters
Table of Contents
Plan change helper
Plan change helper allows you to trigger custom Deluge functions whenever a client performs any of the following actions:
- Upgrades plan
- Downgrades plan
- Renews plan
- Upgrades user add-ons
- Downgrades user add-ons
- Changes subscription cycle from monthly to yearly
- Cancels subscription
For example, you can configure plan change helper to automatically update your Zoho CRM (using Deluge's Zoho CRM integration task) whenever clients upgrade their pricing plan.
- Deluge function that you've configured will be executed immediately after the client alters his plan.
- Five input parameters will be supplied to the Deluge function among which three parameters (client, plan, and subscription) are applicable for all the above-specified actions and two parameters (old_plan and subscription) vary according to the type of action performed. If you try to fetch values of parameters that are not applicable for the particular action, null value will be returned.
- All the parameters are of KEY-VALUE datatype and hold details of the action performed by the client as values against the appropriate keys. You can use get() function to fetch the required values to use them in your Deluge scripts. For example, "client" is the parameter that holds the details of the client and "mail_id" is the key that holds the email address of the client. In order to fetch the email address of the client, you can use the following Deluge script:
email = client.get("mail_id");
General Parameters
The following table lists the parameters and their keys applicable for all the actions of the Plan Change helper:
Parameter | Description | Key | Datatype of the value | Value |
client | Details of the client | mail_id | Email address of the client | |
first_name | First name of the client | |||
plan | Details of the current plan | name | Name of the current plan | |
base_price | Base price of the current plan | |||
markup_price | Markup price of the current plan | |||
minimum_users | Minimum number of users to be purchased with the current plan | |||
annual_discount | Discount applied to the current plan (in dollars per month) | |||
solution | Details of the solution | name | Name of the solution | |
developer_mail_id | Email address of the developer | |||
Plan upgrade
The following table lists the parameters that are applicable if a plan has been upgraded in addition to the general parameters.
Parameter | Description | Key | Datatype of the value | Value |
old_plan | Details of the old plan that the client had subscribed to before upgrading | name | Name of the old plan | |
base_price | Base price of the old plan | |||
markup_price | Markup price of the old plan | |||
minimum_users | Minimum number of users to be purchased with the old plan | |||
annual_discount | Discount applied to the old plan (in dollars per month) | |||
trial | This key holds true if the old plan is the trial plan, and false otherwise. | |||
subscription | Details of the subscription | type | Type of action that the client has performed. This key holds the value "plan_change" if the client has upgraded/downgraded his plan. Other possible values for this key are renewal, user_upgrade, user_downgrade, frequency_change, and cancellation. | |
frequency | Subscription billing cycle. | |||
expiry_date | Expiry date of client's subscription | |||
paid_amount | Amount paid by the client for the upgrading | |||
no_of_users | Number of users that the client has purchased | |||
plan_name | Name of the current plan | |||
old_plan_name | Name of the old plan |
Plan downgrade
The following table lists the parameters that are applicable if a plan has been downgraded in addition to the general parameters.
Parameter | Description | Key | Datatype of the value | Value |
old_plan | Details of the old plan that the client had subscribed to before downgrading | name | Name of the old plan | |
base_price | Base price of the old plan | |||
markup_price | Markup price of the old plan | |||
minimum_users | Minimum number of users to be purchased with the old plan | |||
annual_discount | Discount applied to the old plan (in dollars per month) | |||
subscription | Details of the subscription | type | Type of action that the client has performed. This key holds the value "plan_change" if the client has upgraded/downgraded his plan. Other possible values for this key are renewal, user_upgrade, user_downgrade, frequency_change, and cancellation. | |
frequency | Subscription billing cycle. | |||
expiry_date | Expiry date of client's subscription | |||
no_of_users | Number of users that the client has purchased | |||
plan_name | Name of the current plan | |||
old_plan_name | Name of the old plan |
Plan renewal
The following table lists the parameters that are applicable if the plan has been renewed in addition to the general parameters.
Parameter | Description | Key | Datatype of the value | Value |
subscription | Details of the subscription | type | Type of action that the client has performed. This key holds the value"renewal" if the client has renewed his plan. Other possible values for this key are plan_change, user_upgrade, user_downgrade, frequency_change, and cancellation. | |
frequency | Subscription billing cycle. | |||
expiry_date | Expiry date of client's subscription | |||
paid_amount | Amount paid by the client for renewal | |||
no_of_users | Number of users that the client has purchased | |||
plan_name | Name of the current plan |
User add-on upgrade
The following table lists the parameters that are applicable if user add-ons has been upgraded in addition to the general parameters.
Parameter | Description | Key | Datatype of the value | Value |
subscription | Details of the subscription | type | Type of action that the client has performed. This key holds the value "user_upgrade" if the client has upgraded user add-ons. Other possible values for this key are plan_change, renewal, user_downgrade, frequency_change, and cancellation. | |
frequency | Subscription billing cycle. | |||
expiry_date | Expiry date of client's subscription | |||
paid_amount | Amount paid by the client | |||
plan_name | Name of the current plan | |||
no_of_users_added | Number of additional users that the client has purchased |
User add-on downgrade
The following table lists the parameters that are applicable if the user add-ons has been downgraded in addition to the general parameters.
Parameter | Description | Key | Datatype of the value | Value |
subscription | Details of the subscription | type | Type of action that the client has performed. This key holds the value "user_downgrade" if the client has downgraded user add-ons. Other possible values for this key are plan_change, renewal, user_upgrade, frequency_change, and cancellation. | |
frequency | Subscription billing cycle. | |||
expiry_date | Expiry date of client's subscription | |||
plan_name | Name of the current plan | |||
no_of_users_downgraded | Number of users that the client has laid off |
Change subscription cycle from monthly to yearly
The following table lists the parameters that are applicable if the subscription cycle has been changed from monthly to yearly in addition to the general parameters.
Parameter | Description | Key | Datatype of the value | Value |
subscription | Details of the subscription | type | Type of action that the client has performed. This key holds the value "frequency_change" if the client has changed the billing cycle. Other possible values for this key are plan_change, user_upgrade, renewal, user_downgrade, and cancellation. | |
frequency | Subscription billing cycle. This key holds the value "monthly" in the subscription cycle change from monthly to yearly trigger. | |||
expiry_date | Expiry date of client's subscription | |||
no_of_users | Number of users that the client has purchased | |||
plan_name | Name of the current plan |
Cancel subscription
The following table lists the parameters that are applicable if the subscription has been canceled in addition to the general parameters.
Parameter | Description | Key | Datatype of the value | Value |
subscription | Details of the subscription | type | Type of action that the client has performed. This key holds the value "cancellation" if the client has canceled the subscription. Other possible values for this key are plan_change, user_upgrade, renewal, user_downgrade, and frequency_change. | |
plan_name | Name of the canceled plan | |||
cancellation_type | Possible values:
|
Example
You can use the following Deluge snippet to perform different actions for different types of activities that the client performs with respect to plan:
if(type == "plan_change")
{
// Write Deluge script to perform required actions whenever a client upgrades/ degrades his plan
}
else if(type == "user_upgrade")
{
// Write Deluge script to perform required actions whenever a client upgrades his user addons
}
else if(type == "user_downgrade")
{
// Write Deluge script to perform required actions whenever a client downgrades his user addons
}
else if(type == "renewal")
{
// Write Deluge script to perform required actions whenever a client renews his subscription
}
else if(type == "frequency_change")
{
// Write Deluge script to perform required actions whenever a client changes his billing cycle
}
else if(type == "cancellation")
{
// Write Deluge script to perform required actions whenever a client cancels his subscription
}