Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 29 additions & 12 deletions plugins/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -312,24 +312,41 @@ Available for:
## Notifications


The Notifications plugin provides support for publishing business notifications in SAP Build WorkZone. The client is implemented as a CAP service, which gives us a very simple programmatic API:
The Notifications plugin provides support for publishing business notifications in SAP Build Work Zone. Notification types are defined by annotating CDS events, which the plugin then intercepts and forwards automatically:

```js
let alert = await cds.connect.to ('notifications')
await alert.notify({
recipients: [ ...supporters ],
title: `New incident created by ${customer.info}`,
description: incident.title
```cds
@notification: {
template: {
title : 'New incident: {{title}}',
publicTitle : 'New Incident',
subtitle : 'Created by {{customer}}',
groupedTitle : 'Incident Updates'
}
}
event IncidentCreated {
title : String;
customer : String;
}

this.on('CREATE', 'Incidents', async req => {
await this.emit('IncidentCreated', {
title: req.data.title,
customer: customer.info,
recipients: [ ...supporters ],
})
})
```

Features:

- CAP Services-based programmatic client API → simple, backend-agnostic
- Logging to console in development → fast turnarounds, minimized costs
- Transactional Outbox → maximised scalability and resilience
- Notification templates with i18n support
- Automatic lifecycle management of notification templates
- CAP service-based API — simple, backend-agnostic
- Notification types defined via CDS @notification annotations or JSON
- Auto-emit: annotated CDS events are forwarded to ANS automatically
- Email delivery via configurable delivery channels
- i18n support and dynamic priority for notification types
- Console logging in development — no external service needed
- Transactional outbox — maximised scalability and resilience
- Automatic registration and lifecycle management of notification types on startup


Available for:
Expand Down
Loading