You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"Subtitle": "Incident from '{{customer}}' resolved by {{user}}."
70
+
}
71
+
]
72
+
}
73
+
]
74
+
```
84
75
76
+
### 2. Use pre-defined types in your code like that:
85
77
86
78
```js
87
-
awaitalert.notify ('IncidentResolved', {
88
-
recipients: [ customer.id ],
89
-
data: {
90
-
customer:customer.info,
91
-
title:incident.title,
92
-
user:cds.context.user.id,
93
-
}
94
-
})
79
+
awaitalert.notify ('IncidentResolved', {
80
+
recipients: [ customer.id ],
81
+
data: {
82
+
customer:customer.info,
83
+
title:incident.title,
84
+
user:cds.context.user.id,
85
+
}
86
+
})
95
87
```
96
88
97
-
98
-
99
89
## API Reference
100
90
101
-
102
-
103
91
***recipients** - List of the recipients, this argument is mandatory
104
92
***type** - Notification type key, this argument is mandatory
105
93
***priority** - Priority of the notification, this argument is optional, it defaults to NEUTRAL
106
94
***data** - A key-value pair that is used to fill a placeholder of the notification type template, this argument is optional
107
95
108
-
109
-
110
96
## Test-drive Locally
111
97
In local environment, when you publish notification, it is mocked to publish the nofication to the console.
112
98
@@ -128,77 +114,52 @@ Once application is deployed and [integrated with SAP Build Work Zone](https://g
128
114
129
115
## Advanced Usage
130
116
117
+
### Custom Notification Types Path
131
118
119
+
Notifications plugin configures `srv/notification-types.json` as default notification types file. If you are using different file, you can update the file path in `cds.env.requires.notifications.types`
132
120
133
-
#### Custom Notification Types Path
134
-
135
-
When you run `cds add notifications`, it will add `notificationstype.json` file with template for a notification type in the project root folder. You can add the notification types in the `notificationtype.json` file for sending the custom notification types.
136
-
137
-
#### Custom Notification Type Prefix
121
+
### Custom Notification Type Prefix
138
122
139
-
To make notification types unique to the application, prefix is added to the type key. By default, `application name` is added as the prefix. You can update the `prefix` if required.
123
+
To make notification types unique to the application, prefix is added to the type key. By default, `application name` is added as the prefix. You can update the `cds.env.requires.notifications.prefix` if required.
140
124
141
-
####Low-level Notifications API
125
+
### Low-level Notifications API
142
126
143
127
You can use these two signature to send the custom notification with pre-defined notification types.
144
128
145
-
#####With standard parameters
129
+
#### With pre-defined parameters
146
130
147
131
By using this approach you can post a notification by providing different parts of the notification object grouped in related units
This project is open to feature requests/suggestions, bug reports etc. via [GitHub issues](https://github.com/cap-js/change-tracking/issues). Contribution and feedback are encouraged and always welcome. For more information about how to contribute, the project structure, as well as additional contribution information, see our [Contribution Guidelines](CONTRIBUTING.md).
232
191
233
-
234
192
## Code of Conduct
235
193
236
194
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone. By participating in this project, you agree to abide by its [Code of Conduct](CODE_OF_CONDUCT.md) at all times.
237
195
238
-
239
196
## Licensing
240
197
241
-
Copyright 2023 SAP SE or an SAP affiliate company and contributors. Please see our [LICENSE](LICENSE) for copyright and license information. Detailed information including third-party components and their licensing/copyright information is available [via the REUSE tool](https://api.reuse.software/info/github.com/cap-js/change-tracking).
242
-
243
-
244
-
198
+
Copyright 2023 SAP SE or an SAP affiliate company and contributors. Please see our [LICENSE](LICENSE) for copyright and license information. Detailed information including third-party components and their licensing/copyright information is available [via the REUSE tool](https://api.reuse.software/info/github.com/cap-js/change-tracking).
0 commit comments