Email notification API
The Smart Operations Toolkit sends localized emails based on templates. Applications request notifications through Kafka; templates are managed through REST and MCP. For the template fields and placeholders, see Email templates. For authentication, tenants and general conventions, see Concepts.
All endpoints of the template REST API with their parameters and data structures: Email notification API reference.
Requesting a notification
An application publishes a request to the Kafka topic nfs.request (with the environment-specific topic prefix). Format: JSON, version 1.
{
"tenantId": "t1",
"requestId": "0b8f3b7e-6d62-4b52-9b0f-3a2f6f3c9e11",
"contextId": "cm-rule-triggered",
"placeholders": {
"ruleName": "Spindle temperature too high",
"device": "Milling Center 04",
"measuringPoint": "temperature",
"severity": "warning",
"time": "2026-10-16T10:15:00Z",
"triggeredValue": "81.4"
},
"recipients": [
{ "address": "ada@example.com", "language": "en", "placeholders": { "name": "Ada" } },
{ "address": "bob@example.com", "language": "de" }
]
}
| Field | Description |
|---|---|
|
Tenant of the request. |
|
UUID that the sending application generates. Use the same ID when you publish the same request again. Every recipient of a request receives the email only once. |
|
Purpose of the notification. Selects the template, for example |
|
Values for all recipients. |
|
1 to 100 recipients with |
Delivery
-
The template is selected by
contextIdand the language of the recipient. -
One email is sent per distinct mailbox. Duplicates such as
Ada <ada@example.com>andada@example.comare sent once. -
Every tenant can send at most 100 emails per hour (safety cap).
-
The outcome per recipient is logged for 7 days:
sentorfailedwith the reasontemplate_not_found,placeholder_missing,send_failedortenant_rate_limited. -
Requests that violate the contract are skipped and not stored.
-
Email addresses and placeholder values are never logged or stored.
Template REST API
Base URL:
https://<sot-host>/nfs/api/v1/tenants/{tenantId}
| Path | Method | Purpose | Permission |
|---|---|---|---|
|
|
List templates. Filters: |
|
|
|
Create a template. |
|
|
|
Read a template |
|
|
|
Change subject or body. Context ID and language cannot be changed. |
|
|
|
Delete a template |
|
Subject and body use the Go text/template syntax, for example {{.device}} or {{if .name}}…{{end}}. The syntax is checked when the template is saved.
API für E-Mail-Benachrichtigungen
Das Smart Operations Toolkit versendet lokalisierte E-Mails auf Basis von Vorlagen. Anwendungen fordern Benachrichtigungen über Kafka an; die Vorlagen werden über REST und MCP verwaltet. Felder und Platzhalter der Vorlagen: siehe E-Mail-Vorlagen. Authentifizierung, Tenants und allgemeine Konventionen: siehe Konzepte.
Alle Endpunkte der Vorlagen-REST-API mit ihren Parametern und Datenstrukturen: Referenz der API für E-Mail-Benachrichtigungen.
Benachrichtigung anfordern
Eine Anwendung veröffentlicht eine Anfrage im Kafka-Topic nfs.request (mit dem umgebungsspezifischen Topic-Präfix). Format: JSON, Version 1.
{
"tenantId": "t1",
"requestId": "0b8f3b7e-6d62-4b52-9b0f-3a2f6f3c9e11",
"contextId": "cm-rule-triggered",
"placeholders": {
"ruleName": "Spindle temperature too high",
"device": "Milling Center 04",
"measuringPoint": "temperature",
"severity": "warning",
"time": "2026-10-16T10:15:00Z",
"triggeredValue": "81.4"
},
"recipients": [
{ "address": "ada@example.com", "language": "en", "placeholders": { "name": "Ada" } },
{ "address": "bob@example.com", "language": "de" }
]
}
| Feld | Beschreibung |
|---|---|
|
Tenant der Anfrage. |
|
UUID, die die sendende Anwendung erzeugt. Beim erneuten Veröffentlichen derselben Anfrage dieselbe ID verwenden. Jeder Empfänger einer Anfrage erhält die E-Mail nur einmal. |
|
Zweck der Benachrichtigung. Bestimmt die Vorlage, zum Beispiel |
|
Werte für alle Empfänger. |
|
1 bis 100 Empfänger mit |
Zustellung
-
Die Vorlage wird über
contextIdund die Sprache des Empfängers ausgewählt. -
Je eindeutigem Postfach wird eine E-Mail versendet. Duplikate wie
Ada <ada@example.com>undada@example.comerhalten die E-Mail einmal. -
Jeder Tenant kann höchstens 100 E-Mails pro Stunde versenden (Sicherheitsgrenze).
-
Das Ergebnis je Empfänger wird 7 Tage lang protokolliert:
sentoderfailedmit dem Grundtemplate_not_found,placeholder_missing,send_failedodertenant_rate_limited. -
Anfragen, die gegen den Vertrag verstoßen, werden übersprungen und nicht gespeichert.
-
E-Mail-Adressen und Platzhalterwerte werden nie protokolliert oder gespeichert.
REST-API für Vorlagen
Basis-URL:
https://<sot-host>/nfs/api/v1/tenants/{tenantId}
| Pfad | Methode | Zweck | Berechtigung |
|---|---|---|---|
|
|
Vorlagen auflisten. Filter: |
|
|
|
Vorlage anlegen. |
|
|
|
Vorlage lesen |
|
|
|
Betreff oder Text ändern. Kontext-ID und Sprache lassen sich nicht ändern. |
|
|
|
Vorlage löschen |
|
Betreff und Text verwenden die Syntax von Go text/template, zum Beispiel {{.device}} oder {{if .name}}…{{end}}. Beim Speichern der Vorlage wird die Syntax geprüft.