[Notifications] Sending Notifications on Various Conditions

Article ID: 5744 
Last Review: Nov,25 2008
Author: Elena Nizovtseva
Last updated by: Elena Nizovtseva APPLIES TO:
  • Parallels Business Automation - Enterprise

Symptoms

You may specify a condition for sending a notification in any notification template. Condition is a C++ regular expression, in which available placeholders can be used.

Conditional notifications may be required in the following cases:

1. For sending different notifications depending on what kind of services are included in an order (for example, if it contains a domain or not).
2. For sending different 'order placed' notifications depending on a type of operation under some services (for, example, if an order contains a domain registration or domain transfer)
3. etc.


Resolution

In order to add a condition to a notification you should go to Communication Director > Notification Manager > Notification Templates, select a template, you are going to add a condition to, and type a regular expression in Condition field.
Different notification templates may be required for sending domain or hosting cancellation requests or for sending different order placed notifications.
After the template is created, you should add an event handler for each such notification template: go to  Configuration Director > Event Manager Settings > Event types, find the corersponding event (it can be 'Cancellation Order Placed', 'Order Placed', etc), switch to Event Handler tab and add event handlers.
The parameters of an such event handler must be the following: 

Object = MESSAGE
Method = OrderNotification
Signature = integer OrderID, string TemplateName=<<The name of the notification template>>
Protocol = Stellart
Synchronous = No

Examples:

I. Sending two different notifications in case an order contains a domain or not.

Add the following condition to the notification that you would like to send if an order contains a domain:

"##DetailList#@@Detail_PlanID@##/DetailList#"~="^(ID1)|(ID2)|(ID3)$", where ID1, ID2, ID3 are IDs of domain plans (any number of such IDs , divided by | , can be specified in this expression)

Then open a notification template which will be sent for orders without domains and add the following condition:

"##DetailList#@@Detail_PlanID@##/DetailList#"!~"^(ID1)|(ID2)|(ID3)$", , where ID1, ID2, ID3 are IDs of domain plans (any number of such IDs , divided by | , can be specified in this expression)


II. Sending different 'order placed' notifications for orders containing domain registration or transfering:

The way, how you distinguish domain registration from domain transfering operation, is adding corresponding words to descriptions of subscription periods in service plans (for example, 'Subscription Fee for Domain Registration' or 'Transfer Fee'). The conditions will be the following in this case:

 ##DetailList#@@Detail_Comment@##/DetailList#~="(Registration)" - the condition will be true if the word 'Registration' is found in order details

 ##DetailList#@@Detail_Comment@##/DetailList#~="(Transfer)" -the condition  will be true if the word 'Transfer' is found in order details





Subscription for this article changesSubscription for this article changes

Please provide feedback on this article

Did this article help you solve your issue?
Yes
No
Partially
I do not know yet
 
Strongly Agree   Strongly Disagree
  9 8 7 6 5 4 3 2 1
The article is easy to understand
The article is accurate
Additional Comments:
*Please provide us with your email address in case we need to contact you.
* - required fields