diff --git a/plugins/index.md b/plugins/index.md index 251b3d857..481bc8df2 100644 --- a/plugins/index.md +++ b/plugins/index.md @@ -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: