Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
RamIndia authored Oct 26, 2023
1 parent a171a71 commit 129d354
Showing 1 changed file with 31 additions and 27 deletions.
58 changes: 31 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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({
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 129d354

Please sign in to comment.