diff --git a/README.md b/README.md index f20684a..cd7d188 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,8 @@ The `@cap-js/notifications` package is a [CDS plugin](https://cap.cloud.sap/docs - [Simple Notification with title](#simple-notification-with-title) - [Simple Notification with title and description](#simple-notification-with-title-and-description) - [Custom Notifications](#custom-notifications) + - [With standard parameters](#with-standard-parameters) + - [Passing the whole notification object](#passing-the-whole-notification-object) - [Sample Application with notifications](#sample-application-with-notifications) - [In Local Environment](#in-local-environment) - [In Production Environment](#in-production-environment) @@ -109,34 +111,8 @@ alert.notify({ #### Custom Notifications You can use these two signature to send the custom notification with pre-defined notification types. -#### Passing the whole notification object -By using this approach you need to pass the whole notification object as described in the API documentation -```js -alert.notify({ - NotificationTypeKey: 'IncidentCreated', - NotificationTypeVersion: '1', - Priority: 'NEUTRAL', - Properties: [ - { - Key: 'name', - IsSensitive: false, - Language: 'en', - Value: 'Engine overheating', - Type: 'String' - }, - { - Key: 'customer', - IsSensitive: false, - Language: 'en', - Value: 'John', - Type: 'String' - } - ], - Recipients: ["admin1@test.com","admin2@test.com"] -}); -``` +##### With standard parameters -#### Passing the notification object in parts By using this approach you can post a notification by providing different parts of the notification object grouped in related units ```js alert.notify({ @@ -191,6 +167,34 @@ Possible parameters: * **navigation** - All navigation related parameters, this argument is optional * **payload** - The rest parameters that can be passed, this argument is optional +##### Passing the whole notification object + +By using this approach you need to pass the whole notification object as described in the API documentation +```js +alert.notify({ + NotificationTypeKey: 'IncidentCreated', + NotificationTypeVersion: '1', + Priority: 'NEUTRAL', + Properties: [ + { + Key: 'name', + IsSensitive: false, + Language: 'en', + Value: 'Engine overheating', + Type: 'String' + }, + { + Key: 'customer', + IsSensitive: false, + Language: 'en', + Value: 'John', + Type: 'String' + } + ], + Recipients: ["admin1@test.com","admin2@test.com"] +}); +``` + ### Sample Application with notifications #### In Local Environment