In this article
The example below demonstrates the four default styles available through the plugin: error, warning, success and tip.
You can make your notifications dismissible using the
To create notifications you must either:
- Define the notification content using the
contentoption, which can be static text or Dynamic Content if you need to support multiple languages.
- Identify articles to convert into notifications using the
labelsoption, which is a comma-separated list of article labels. The plugin will convert each article matching one or more of the labels you provide into a notification, using the article content as the notification content.
special_user, you could use the following code:
Any other user property could be used as a condition, like the user’s role or organization membership. To learn more about the user properties returned by the Zendesk REST API, refer to their online documentation.
|content|| || ||The content to display within your notification.|
|labels|| || ||A comma-separated list of labels used to identify articles.|
|type|| || ||The type of notification to use ( |
|dismissible|| || ||True if the notifications should be dismissible.|
|template|| || ||The name of the template to use.|
|templateData|| || ||Additional data to expose to the templating function.|
Using custom micro-templates you can customize the appearance and behavior of the notifications and even present other data within them like the article title. The templating function will receive one or more notification objects. Each notification object has the following properties:
notificationswhich is an array of notification objects, each with the following properties:
url(only populated if articles are used)
title(only populated if articles are used)
| ||Fires when the notification has been rendered.|