Skip to content

Commit 8053732

Browse files
committed
Update Readme
1 parent ffad3b5 commit 8053732

File tree

1 file changed

+59
-1
lines changed

1 file changed

+59
-1
lines changed

README.md

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,10 @@ alert.notify({
106106
});
107107
```
108108
#### **Custom Notifications with notification types**
109-
You can use the following signature to send the custom notification with pre-defined notification types.
109+
You can use these two signature to send the custom notification with pre-defined notification types.
110+
111+
##### **Passing the whole notification object**
112+
By using this approach you need to pass the whole notification object as described in the API documentation
110113
```js
111114
alert.notify({
112115
NotificationTypeKey: 'IncidentCreated',
@@ -132,6 +135,61 @@ alert.notify({
132135
});
133136
```
134137

138+
##### **Passing the notification object in parts**
139+
By using this approach you can post a notification by providing different parts of the notification object grouped in related units
140+
```js
141+
alert.notify({
142+
recipients: recipients,
143+
type: "IncidentCreated"
144+
priority: 'NEUTRAL',
145+
properties: [
146+
{
147+
Key: 'name',
148+
IsSensitive: false,
149+
Language: 'en',
150+
Value: 'Engine overheating',
151+
Type: 'String'
152+
},
153+
{
154+
Key: 'customer',
155+
IsSensitive: false,
156+
Language: 'en',
157+
Value: 'John',
158+
Type: 'String'
159+
}
160+
],
161+
navigation: {
162+
NavigationTargetAction: "displayInbox",
163+
NavigationTargetObject: "WorkflowTask",
164+
}
165+
payload: {
166+
Id: "01234567-89ab-cdef-0123-456789abcdef",
167+
OriginId: "Example Origin Id",
168+
NotificationTypeId: "01234567-89ab-cdef-0123-456789abcdef",
169+
NotificationTypeVersion: "1",
170+
ProviderId: "/SAMPLEPROVIDER",
171+
ActorId: "BACKENDACTORID",
172+
ActorDisplayText: "ActorName",
173+
ActorImageURL: "https://some-url",
174+
NotificationTypeTimestamp: "2022-03-15T09:58:42.807Z",
175+
TargetParameters: [
176+
{
177+
"Key": "string",
178+
"Value": "string"
179+
}
180+
]
181+
}
182+
});
183+
```
184+
185+
Possible parameters:
186+
* **recipients** - List of the recipients
187+
* **type** - Notification type key
188+
* **priority** - Priority of the notification
189+
* **properties** - A key-value pair that is used to fill a placeholder of the notification type template
190+
* **navigation** - All navigation related parameters
191+
* **payload** - The rest parameters that can be passed
192+
135193
### Sample Application with notifications
136194

137195
#### **In Local Environment**

0 commit comments

Comments
 (0)