-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
31 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: ["[email protected]","[email protected]"] | ||
}); | ||
``` | ||
##### 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: ["[email protected]","[email protected]"] | ||
}); | ||
``` | ||
|
||
### Sample Application with notifications | ||
|
||
#### In Local Environment | ||
|