Skip to content

Commit 129d354

Browse files
authored
Update README.md
1 parent a171a71 commit 129d354

File tree

1 file changed

+31
-27
lines changed

1 file changed

+31
-27
lines changed

README.md

Lines changed: 31 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ The `@cap-js/notifications` package is a [CDS plugin](https://cap.cloud.sap/docs
1616
- [Simple Notification with title](#simple-notification-with-title)
1717
- [Simple Notification with title and description](#simple-notification-with-title-and-description)
1818
- [Custom Notifications](#custom-notifications)
19+
- [With standard parameters](#with-standard-parameters)
20+
- [Passing the whole notification object](#passing-the-whole-notification-object)
1921
- [Sample Application with notifications](#sample-application-with-notifications)
2022
- [In Local Environment](#in-local-environment)
2123
- [In Production Environment](#in-production-environment)
@@ -109,34 +111,8 @@ alert.notify({
109111
#### Custom Notifications
110112
You can use these two signature to send the custom notification with pre-defined notification types.
111113

112-
#### Passing the whole notification object
113-
By using this approach you need to pass the whole notification object as described in the API documentation
114-
```js
115-
alert.notify({
116-
NotificationTypeKey: 'IncidentCreated',
117-
NotificationTypeVersion: '1',
118-
Priority: 'NEUTRAL',
119-
Properties: [
120-
{
121-
Key: 'name',
122-
IsSensitive: false,
123-
Language: 'en',
124-
Value: 'Engine overheating',
125-
Type: 'String'
126-
},
127-
{
128-
Key: 'customer',
129-
IsSensitive: false,
130-
Language: 'en',
131-
Value: 'John',
132-
Type: 'String'
133-
}
134-
],
135-
136-
});
137-
```
114+
##### With standard parameters
138115

139-
#### Passing the notification object in parts
140116
By using this approach you can post a notification by providing different parts of the notification object grouped in related units
141117
```js
142118
alert.notify({
@@ -191,6 +167,34 @@ Possible parameters:
191167
* **navigation** - All navigation related parameters, this argument is optional
192168
* **payload** - The rest parameters that can be passed, this argument is optional
193169

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
173+
```js
174+
alert.notify({
175+
NotificationTypeKey: 'IncidentCreated',
176+
NotificationTypeVersion: '1',
177+
Priority: 'NEUTRAL',
178+
Properties: [
179+
{
180+
Key: 'name',
181+
IsSensitive: false,
182+
Language: 'en',
183+
Value: 'Engine overheating',
184+
Type: 'String'
185+
},
186+
{
187+
Key: 'customer',
188+
IsSensitive: false,
189+
Language: 'en',
190+
Value: 'John',
191+
Type: 'String'
192+
}
193+
],
194+
195+
});
196+
```
197+
194198
### Sample Application with notifications
195199

196200
#### In Local Environment

0 commit comments

Comments
 (0)