Create notification templates and conditions
The Advanced (v2) notification system includes one predefined Default template for each of the following notification methods:
- SMS
- Off platform
Marketplace Managers can define one or more custom notification templates for each notification method. The v2 notification system uses these templates to generate and send a notification for a given marketplace event and its associated notification type (for example, the Product Purchased notification type). Custom templates can include (but don't required) user-defined notification condition. If configured, conditions are used to evaluate which—if any—of the custom templates is used to generate and send a notification. If the notification system determines that none of the custom templates are appropriate for the associated event, it uses the predefined Default notification template to generate the notification.
You can also target notifications to specific customer segments. For example, you can create a new version of a notification and target that new template to a specific group of customers. In order to do this, you need to have previously created segments. For more information, See Segments.
You can add one or more conditions, or add segments, or you can define both conditions and segments.
The notification system evaluates each condition in each template associated with a notification type to determine if the template evaluates to True. The first template that evaluates to True (that is, all of a template's conditions evaluate to True) is used to generate and send a notification for the associated event. Each condition includes three elements—a parameter, an operator, and a value—that construct a logical phrase that the notification system evaluates to determine whether it matches the marketplace event.
Whether or not a template is sent is also defined by whether or not it is set to be triggered. For more information, see Set notification template priority.
To create a notification template
-
Go to Manage > Marketplace > Settings > Custom UI | Notifications. The Notifications page opens.
-
Click the row of the notification for which you want to define a new notification template. The default email template opens. Depending on your settings, three notification types might appear: Email, SMS, and Off-platform.
-
(Optional) Click one of the other delivery methods for the new template: SMS or Off platform. The Default template appears for the selected delivery method. If you click Off platform, you must enter a target URL for the Default template before you add a new template.
-
Click the Default drop-down button, then select + New Template from the drop-down list. The Create New Template page opens.
-
Enter a template name. The template name cannot contain spaces but can contain special characters, including dashes, underscore, and so on.
-
Enter a description.
-
(Optional) Click Add Condition. The Create a Condition dialog opens.
- Select a predefined option from the Parameter drop-down menu. The parameter is the entity to which the condition is applied. Parameters represent a general classification (for example, a company) while the value is specific (a company named Acme). The available parameters differ from one notification type to another (for example, applicationID is included in the Product Purchase notification type, but not in the New Account Created notification type).
- Select an option from the Operator drop-down menu. The operator determines the relationship between the condition’s parameter and value. For example, the operator equals states that the parameter must match the value (companyName equals Acme). The available operators are as follows:
- Equals
- Does not equal
- Contains
- Does not contain
- Includes any of
- Does not include any of
- Enter a value in the Value field. The value is the specific data used with the parameter and operator for evaluation. The value is the specific information compared to the parameter's more general information.
Note the following when entering values:- Value field entries are case sensitive: mycompany does not match MyCompany.
- If you selected either includes any of or does not include any of in the Operator field (in step c), enter the values using comma-separated entries, for example, entry1, entry2, entry3 or entry1, entry2, entry3.
- Click Save Condition. The condition is created and associated with this template. It appears in the Conditions table in the New Template Setup dialog.
- (Optional) Repeat this step to add additional conditions as required. When templates with multiple conditions are evaluated, all conditions must evaluate to True for the template to evaluate to True and be selected to generate the notification. If any of this template's conditions evaluate to False, the template is rejected and the template with the next highest priority is evaluated.
-
(Optional) If you do not want this template to send a notification if it evaluates to True, click the Do not send notifications matching these conditions toggle.
-
(Optional) To ensure the condition's combination of parameter, operator, and value are accepted by the notification type's structural definition (also known as the schema), click Validate Conditions.
For example, if your condition includes the applicationName parameter, the contains operator, and the soft value, you can test it to see whether it is valid for either or both of Microsoft Office365 and MuleSoft Anypoint Design Center. For more information, see Validate notification template conditions. -
(Optional) To add segments, select a segment folder in the left column of the Segments pane, then select segments to add to the template. You can add as many segments as needed.
-
Configure the audience. The To field is pre-configured to be the intended recipient type for the notification but you can add email addresses to the cc and bcc fields.
-
Configure the email content, as follows:
- Language
- Subject line
- Body content
-
(Optional) Add parameters to the template, if required. Parameters are variables that serve as placeholders in the template. When the notification is generated, the system replaces the parameter with the appropriate value. For more information about the list and descriptions of available parameters, see Parameter descriptions. After you click on a parameter, it appears where your cursor is placed in the template. You can also click and drag the parameter to a specific place in the template. Note the following:
- Advanced parameters contain nested properties or are organized in an array. When you add advanced parameters to a template, you must update them manually in a dot-separated format (for example, user.address.city). Advanced parameters are available for a limited number of email notification templates—for example, the Product Purchased template.
For example, to include a table that contains all of the order items in the purchase order, you can use the following HTML code:
<table>
{th:for-each=$orders}
<tr>Order Id </tr>
<tr>{orders[i].id} </tr>
{th:for-each}
</table>-
The Custom attribute parameters pane only includes attributes that the Marketplace Manager defined as company attributes (see Set custom attributes for more information). After you add a custom attribute parameter, to ensure that the email notification includes both the custom attribute's label and its associated value, add
.label
and.value
after the parameter within the curly brackets, as shown in the following example:{customAttributes_COMPANY_Key_1.label}:{customAttributes_COMPANY_Key_1.value}
. You need to manually add the colon (or any other symbol or text) if you want it to appear in the customer's email.
Note: If you only click the parameter to add it to the template and do not specify the dot operator, the information displayed to the customer defaults to
{customAttributes_COMPANY_Key_1.value}
, and no label is displayed in the email. - Advanced parameters contain nested properties or are organized in an array. When you add advanced parameters to a template, you must update them manually in a dot-separated format (for example, user.address.city). Advanced parameters are available for a limited number of email notification templates—for example, the Product Purchased template.
-
(Optional) Configure the template to require the email recipient to enter a password to view the attached invoice. Click the Attachments drop-down list, select PDF invoice. This option is currently available only for the Invoice PDF Created notification. See Configure the PDF attachment policy for more information.
-
Click Create Template. A message confirms that the template was created and that its status is Disabled. Disabled notification templates are not evaluated by the notification system when it searches for a template to use for a notification.
-
(Optional) Click the Status toggle to change the status of the new template from Disabled to Enabled.
-
(Optional) Configure the template to be available in other languages so that the notification can be sent in the user's preferred language. To do this:
- Create a new version of the template using the preceding procedure.
- Open the new version, then select the language from the drop-down list.
- Enter the content details in that language.
- Click Save. The additional language is added.
- Repeat the process for additional languages.
-
(Optional) To assign a priority to the new template (if you have more than one version of the template), see Set notification template priority. You can only prioritize templates that have the Enabled status.
-
(Optional) To Manage the unsubscribe link that appears in the email footer, see Manage the unsubscribe feature.
To view the default content for each notification type, see Notification template content.
Was this page helpful?
Tell us more…
Help us improve our content. Responses are anonymous.
Thanks
We appreciate your feedback!