@@ -16,6 +16,8 @@ The `@cap-js/notifications` package is a [CDS plugin](https://cap.cloud.sap/docs
16
16
- [ Simple Notification with title] ( #simple-notification-with-title )
17
17
- [ Simple Notification with title and description] ( #simple-notification-with-title-and-description )
18
18
- [ Custom Notifications] ( #custom-notifications )
19
+ - [ With standard parameters] ( #with-standard-parameters )
20
+ - [ Passing the whole notification object] ( #passing-the-whole-notification-object )
19
21
- [ Sample Application with notifications] ( #sample-application-with-notifications )
20
22
- [ In Local Environment] ( #in-local-environment )
21
23
- [ In Production Environment] ( #in-production-environment )
@@ -105,8 +107,69 @@ alert.notify({
105
107
description: " Incident titled 'Engine overheating' created by 'customer X' with priority high is assigned to you!"
106
108
});
107
109
```
110
+
108
111
#### Custom Notifications
109
- You can use the following signature to send the custom notification with pre-defined notification types.
112
+ You can use these two signature to send the custom notification with pre-defined notification types.
113
+
114
+ ##### With standard parameters
115
+
116
+ By using this approach you can post a notification by providing different parts of the notification object grouped in related units
117
+ ``` js
118
+ alert .notify ({
119
+
120
+ type: " IncidentCreated"
121
+ priority: ' NEUTRAL' ,
122
+ properties: [
123
+ {
124
+ Key: ' name' ,
125
+ IsSensitive: false ,
126
+ Language: ' en' ,
127
+ Value: ' Engine overheating' ,
128
+ Type: ' String'
129
+ },
130
+ {
131
+ Key: ' customer' ,
132
+ IsSensitive: false ,
133
+ Language: ' en' ,
134
+ Value: ' John' ,
135
+ Type: ' String'
136
+ }
137
+ ],
138
+ navigation: {
139
+ NavigationTargetAction: " displayInbox" ,
140
+ NavigationTargetObject: " WorkflowTask" ,
141
+ }
142
+ payload: {
143
+ Id: " 01234567-89ab-cdef-0123-456789abcdef" ,
144
+ OriginId: " Example Origin Id" ,
145
+ NotificationTypeId: " 01234567-89ab-cdef-0123-456789abcdef" ,
146
+ NotificationTypeVersion: " 1" ,
147
+ ProviderId: " /SAMPLEPROVIDER" ,
148
+ ActorId: " BACKENDACTORID" ,
149
+ ActorDisplayText: " ActorName" ,
150
+ ActorImageURL: " https://some-url" ,
151
+ NotificationTypeTimestamp: " 2022-03-15T09:58:42.807Z" ,
152
+ TargetParameters: [
153
+ {
154
+ " Key" : " string" ,
155
+ " Value" : " string"
156
+ }
157
+ ]
158
+ }
159
+ });
160
+ ```
161
+
162
+ Possible parameters:
163
+ * ** recipients** - List of the recipients, this argument is mandatory
164
+ * ** type** - Notification type key, this argument is mandatory
165
+ * ** priority** - Priority of the notification, this argument is optional, it defaults to NEUTRAL
166
+ * ** properties** - A key-value pair that is used to fill a placeholder of the notification type template, this argument is optional
167
+ * ** navigation** - All navigation related parameters, this argument is optional
168
+ * ** payload** - The rest parameters that can be passed, this argument is optional
169
+
170
+ ##### Passing the whole notification object
171
+
172
+ By using this approach you need to pass the whole notification object as described in the API documentation
110
173
``` js
111
174
alert .notify ({
112
175
NotificationTypeKey: ' IncidentCreated' ,
0 commit comments