Atomia Billing Server

Reminders, Suspend and Terminate Process

23 views 0

Configuration description

Namespace:Atomia.Billing.Plugins.GenericWorkflowPlugin.ScheduledTasks.InvoiceReminderScheduledEventHandler

This workflow is used to send reminders and execute actions (for example: to suspend and terminate subscriptions) for unpaid invoices. It is possible to define different reminders and actions for different product categories.

Example configuration:

            {
              "ReminderConfigurations": [
                {
                  "Key": "B77B8B91-741B-4CF1-88B4-FEB21550055C",
                  "Value": {
                     "ApprovedItemsCount":1000,
                     "ScheduleItemsCount":1000,
                       "ApplyToSubresellers":true,
                     "InvoiceReminders":[
                        {
                           "AutoApprove":true,
                           "MessageType":0,
                           "Name":"InvoiceReminder1",
                           "SendOnWorkingDayOnly":true,
                           "SendOnPreviousWorkingDay":true,
                           "TemplateNamePrefix":"InvoiceReminder1Email",
                           "AdditionalOffset":3,
                           "AttachInvoice":true,
                           "RelativeToDueDate":false,
                           "CategoriesConfigurations":[
                              {
                                 "Categories":[

                                 ],
                                 "DaysOffset":22,
                                 "Filter":"all",
                                 "ApplicableTo":"any",
                                 "HandlersConfiguration":null,
                                 "Order":1
                              }
                           ],
                           "RelativeToReminder":null
                        },
                        {
                           "AutoApprove":true,
                           "MessageType":0,
                           "Name":"InvoiceReminder2",
                           "SendOnPreviousWorkingDay":true,
                           "SendOnWorkingDayOnly":true,
                           "TemplateNamePrefix":"InvoiceReminder2Email",
                           "AdditionalOffset":3,
                           "AttachInvoice":true,
                           "RelativeToDueDate":false,
                           "CategoriesConfigurations":[
                              {
                                 "Categories":[
                                    "Domain",
                                    "DomainTransfer"
                                 ],
                                 "DaysOffset":30,
                                 "Filter":"all",
                                 "ApplicableTo":"renewal",
                                 "HandlersConfiguration":null,
                                 "Order":1
                              },
                              {
                                 "Categories":[

                                 ],
                                 "DaysOffset":27,
                                 "Filter":"all",
                                 "HandlersConfiguration":null,
                                 "Order":2
                              }
                           ],
                           "RelativeToReminder":null
                        },
                        {
                           "AutoApprove":true,
                           "MessageType":2,
                           "Name":"InvoiceReminder3",
                           "PrintEmail":"[email protected]",
                           "SendOnPreviousWorkingDay":true,
                           "SendOnWorkingDayOnly":true,
                           "TemplateNamePrefix":"InvoiceReminder3Print",
                           "AdditionalOffset":3,
                           "AttachInvoice":true,
                           "RelativeToDueDate":false,
                           "CategoriesConfigurations":[
                              {
                                 "Categories":[
                                    "Domain",
                                    "DomainTransfer"
                                 ],
                                 "DaysOffset":30,
                                 "Filter":"all",
                                 "HandlersConfiguration":null,
                                 "Order":1
                              },
                              {
                                 "Categories":[

                                 ],
                                 "DaysOffset":27,
                                 "Filter":"all",
                                 "HandlersConfiguration":null,
                                 "Order":2
                              }
                           ],
                           "RelativeToReminder":null
                       },
                       {
                          "AutoApprove":true,
                          "MessageType":0,
                          "Name":"DebtCollecting",
                          "SendOnPreviousWorkingDay":false,
                          "SendOnWorkingDayOnly":false,
                          "AdditionalOffset":0,
                          "AttachInvoice":true,
                          "CategoriesConfigurations":[{
                              "Categories":[],
                              "DaysOffset":30,
                              "Filter":"all",
                              "HandlersConfiguration":{
                                "ActionHandlers":[{
                                    "ClassName":"Atomia.Billing.Plugins.GenericWorkflowPlugin.CustomActions.InvoiceDebtCollectionCustomAction, Atomia.Billing.Plugins.GenericWorkflowPlugin",
                                    "Parameters":[
                                      { "Key":"DebtCollectionPlugin", "Value":"ECollectPlugin" }, 
                                      { "Key":"CreditInvoice", "Value":"true" }, 
                                      { "Key":"DaysLimit", "Value":"0" }
                                    ]
                                  }
                                ]
                              },
                              "Order":1
                            }
                          ]
                       },
                       {
                           "AutoApprove":true,
                           "MessageType":0,
                           "Name":"SuspendServices",
                           "SendOnPreviousWorkingDay":false,
                           "SendOnWorkingDayOnly":false,
                           "TemplateNamePrefix":null,
                           "AdditionalOffset":0,
                           "AttachInvoice":true,
                           "RelativeToDueDate":false,
                           "CategoriesConfigurations":[
                              {
                                 "Categories":[
                                    "O365"
                                 ],
                                 "DaysOffset":23,
                                 "Filter":"all",
                                 "HandlersConfiguration":{
                                    "ActionHandlers":[
                                       {
                                          "ClassName": "Atomia.Billing.Plugins.GenericWorkflowPlugin.CustomActions.SuspendInvoiceSubscriptionsCustomAction, Atomia.Billing.Plugins.GenericWorkflowPlugin",
                                          "Parameters": [
                          { "Key": "AllowedSubscriptionStates", "Value": "Ok,Renewal,Renewed" },
                          { "Key": "DisallowedSubscriptionStates", "Value": "Suspended" }
                      ]
                                       }
                                    ],
                                    "TemplateNamePrefix":null
                                 },
                                 "Order":1
                              },
                              {
                                 "Categories":[

                                 ],
                                 "DaysOffset":30,
                                 "Filter":"all",
                                 "HandlersConfiguration":{
                                    "ActionHandlers":[
                                       {                        "ClassName":"Atomia.Billing.Plugins.GenericWorkflowPlugin.CustomActions.SuspendInvoiceSubscriptionsCustomAction, Atomia.Billing.Plugins.GenericWorkflowPlugin",
                                          "Parameters":null
                                       }
                                    ],
                                    "TemplateNamePrefix":null
                                 },
                                 "Order":2
                              }
                           ],
                           "RelativeToReminder":null
                        },
                        {
                           "AutoApprove":true,
                           "MessageType":0,
                           "Name":"TerminateServices",
                           "SendOnPreviousWorkingDay":false,
                           "SendOnWorkingDayOnly":false,
                           "TemplateNamePrefix":null,
                           "AdditionalOffset":0,
                           "AttachInvoice":true,
                           "RelativeToDueDate":false,
                           "CategoriesConfigurations":[
                              {
                                 "Categories":[
                                    "Domain",
                                    "DomainTransfer"
                                 ],
                                 "DaysOffset":68,
                                 "Filter":"all",
                                 "HandlersConfiguration":{
                                    "ActionHandlers":[
                                       {
                                          "ClassName": "Atomia.Billing.Plugins.GenericWorkflowPlugin.CustomActions.TerminateInvoiceSubscriptionsCustomAction, Atomia.Billing.Plugins.GenericWorkflowPlugin",
                                          "Parameters":null
                                       },
                                       {
                                          "ClassName": "Atomia.Billing.Plugins.GenericWorkflowPlugin.CustomActions.AutoCreditInvoicesCustomAction, Atomia.Billing.Plugins.GenericWorkflowPlugin",
                                          "Parameters":null
                                       }
                                    ],
                                    "TemplateNamePrefix":"BadDebtTerminationEmail"
                                 },
                                 "Order":1
                              },
                              {
                                 "Categories":[

                                 ],
                                 "DaysOffset":60,
                                 "Filter":"all",
                                 "HandlersConfiguration":{
                                    "ActionHandlers":[
                                       {
                                          "ClassName": "Atomia.Billing.Plugins.GenericWorkflowPlugin.CustomActions.TerminateInvoiceSubscriptionsCustomAction, Atomia.Billing.Plugins.GenericWorkflowPlugin",
                                          "Parameters":null
                                       },
                                       {
                                          "ClassName": "Atomia.Billing.Plugins.GenericWorkflowPlugin.CustomActions.AutoCreditInvoicesCustomAction, Atomia.Billing.Plugins.GenericWorkflowPlugin",
                                          "Parameters":null
                                       }
                                    ],
                                    "TemplateNamePrefix":"BadDebtTerminationEmail"
                                 },
                                 "Order":2
                              }
                           ],
                           "RelativeToReminder":null
                        }
                     ],
                 "MessageHandlers":null
                  }
                }
              ]
            }

Renewal options are specified by JSON structure with the following entries:

  • Key Which reseller the configuration applies to.
  • Value The configuration for the reseller.
  • ScheduleItemsCount Limit the number of invoices to be scheduled for reminder sending during one run. Zero means no limit.
  • ApprovedItemsCount Limit the number of invoice reminder tasks to be auto-approved during one run. Zero means no limit.
  • ApplyToSubresellers If set and the configuration is reseller specific, then it also applies to customers of subresellers of the reseller with the configuration.
  • MessageHandlers This is a dictionary of which classes are used to handle different message types. If not specified or null, this matches:
                    { 
                      "Email": "Atomia.Billing.Plugins.GenericWorkflowPlugin.ScheduledTasks.EmailInvoiceReminderHandler, Atomia.Billing.Plugins.GenericWorkflowPlugin",
                      "Sms": "Atomia.Billing.Plugins.GenericWorkflowPlugin.ScheduledTasks.SmsInvoiceReminderHandler, Atomia.Billing.Plugins.GenericWorkflowPlugin",
                      "Print": "Atomia.Billing.Plugins.GenericWorkflowPlugin.ScheduledTasks.PrintInvoiceReminderHandler, Atomia.Billing.Plugins.GenericWorkflowPlugin"
                    }
    
  • InvoiceReminders[ ] This is a list of configuration options for different reminder actions. Every entry is a set of configuration options for one step in the workflow.
  • InvoiceReminders[ ].Name The descriptive name of the reminder or other kind of action.
  • InvoiceReminders[ ].AutoApprove Should the action be auto-approved.
  • InvoiceReminders[ ].MessageType The message type (0 – Email, 1 – SMS, 2 – Print). Email and SMS sends the reminder directly to the customer. Print sends a merged copy of all the reminders produced by one run of the task to the email specified by theInvoiceReminders[ ].PrintEmail option described below.
  • InvoiceReminders[ ].PrintEmail The (internal) email address to send print-reminders to, if MessageType is set to 2.
  • InvoiceReminders[ ].SendOnWorkingDayOnly Will this action be run work days only (true/false).
  • InvoiceReminders[ ].SendOnPreviousWorkingDay Should the invoice be sent on previous (true) or next work day (false).
  • InvoiceReminders[ ].TemplateNamePrefix The template name prefix. For example if this prefix is “Reminder1”, then the system will look for “Reminder1Subject” and “Reminder1Body” in case of Email message or “Reminder1SMS” in case of SMS message. If the prefix is null no message will be sent.
  • InvoiceReminders[ ].AdditionalOffset Additional days in advance to run the action / send the reminder. This number is added on top of the number calculated by the InvoiceReminders[ ].CategoriesConfigurations[ ] configuration.
  • InvoiceReminders[ ].AttachInvoice Should the original invoice be attached to a message (in case of email).
  • InvoiceReminders[ ].RelativeToDueDate If set to true offset will be relative to due date, otherwise it will be relative to invoice date. False is the default value for this option.
  • InvoiceReminders[ ].RelativeToReminder If you want this reminder date to be counted relative from the invoice date, set this to “null”. Otherwise put a name (InvoiceReminders[ ].Name of the previous reminder).
  • InvoiceReminders[ ].CategoriesConfigurations[ ] You can have different configuration options for different categories. This is a list of configuration settings – one entry per group of categories.
  • InvoiceReminders[ ].CategoriesConfigurations[ ].Categories[ ] List of categories this configuration is applicable to. Empty list means – all the other categories (the ones that don’t appear in other entries).NOTE: if the invoice lines contain products from different categories, system will apply only one action to each product line (subscription).
  • InvoiceReminders[ ].CategoriesConfigurations[ ].DaysOffset When to send this reminder / run this action – relative to invoice date (or previous reminder date in case that InvoiceReminders[ ].RelativeToReminder is not null).
  • InvoiceReminders[ ].CategoriesConfigurations[ ].Filter Use this field for additional filtering of products this action is applicable to.NOTE: Properties Categories[ ] andFilter are used together to determine if action is applicable to the invoice. Filter can have one of two values: “all” and “any”. For “all”, all invoice lines of have to be in specified categories and for “any” it is sufficient that any of them have needed category.
  • InvoiceReminders[ ].CategoriesConfigurations[ ].ApplicableTo Use this field for additional filtering of which invoices this action is applicable to.ApplicableTo can have one of the following values: “any”, “renewal”, “somerenewal”, “somenew”, “norenewal”. The value “any” means “any kind of invoice matching the other rules” and is the default. The value “renewal” means “invoices containing only renewal subscriptions”. The value “norenewal” means “invoices without any renewal subscription”. The value “somenew” means “invoices with some subscription that is not a renewal”. The value “somerenewal” means “invoices where at least one subscription is a renewal”.
  • InvoiceReminders[ ].CategoriesConfigurations[ ].Order The order of execution of reminders / actions (among the entries in CategoriesConfigurations[ ]).
  • InvoiceReminders[ ].CategoriesConfigurations[ ].HandlersConfiguration This section contains the configuration of handlers – the actions to be taken.
  • InvoiceReminders[ ].CategoriesConfigurations[ ].HandlersConfiguration.TemplateNamePrefix Using this option you can specify the template for additional notification which can be used by ActionHandler.
  • InvoiceReminders[ ].CategoriesConfigurations[ ].HandlersConfiguration.ActionHandlers[ ] You can invoke several actions (like suspending the subscription), which is defined by the entries of this option.
  • InvoiceReminders[ ].CategoriesConfigurations[ ].HandlersConfiguration.ActionHandlers[ ].ClassName Namespace and the class name of the .Net class which will execute this action.
  • InvoiceReminders[ ].CategoriesConfigurations[ ].HandlersConfiguration.ActionHandlers[ ].Parameters Parameters to be passed to action class.

Was this helpful?