Email templates

A template defines the subject and the body of an email for one purpose and one language. You view and change templates with the agent.

Prerequisite

  • ai_chat:read permission to use the agent

  • templates:read permission to see templates

  • templates:write permission to create and change templates

  • templates:delete permission to delete templates

Template fields

Field Description

Context ID

Purpose of the template, for example cm-rule-triggered for rule events. The Smart Operations Toolkit uses this ID to select the template.

Language

en (English) or de (German). Every context ID can have one template per language.

Subject

Subject of the email. Can contain placeholders.

Body

Text of the email. Can contain placeholders.

Origin

Default for templates that are provided with the Smart Operations Toolkit, Custom for templates that were created by your organization.

The context ID and the language of a template cannot be changed after the template was created.

Placeholders

Placeholders are written in double curly brackets with a leading dot, for example {{.device}}. When the email is sent, the placeholder is replaced by its value. Conditions are possible as well, for example {{if .name}}Hello {{.name}},{{end}}.

Placeholders of the template for rule events

The template cm-rule-triggered exists in English and German.

Placeholder Content

{{.severity}}

Severity of the event, for example warning

{{.ruleName}}

Name of the rule

{{.device}}

Device on which the rule was triggered

{{.measuringPoint}}

Monitored measuring point

{{.time}}

Time when the rule was triggered

{{.triggeredValue}}

Value that triggered the rule

{{.ruleParams}}

Parameters of the rule, for example the thresholds (optional)

{{.name}}

Name of the recipient (optional)

Viewing templates

Ask the agent, for example:

Which notification templates exist?
Show the English template cm-rule-triggered.
Email templates

Changing a template

  1. Ask the agent, for example:

    Change the subject of the English template cm-rule-triggered to "{{.severity}}: {{.ruleName}} on {{.device}} ({{.measuringPoint}})".
  2. Check the change that the agent shows and confirm it.

The template is changed. The next emails use the new text.

The agent keeps the placeholders exactly as you write them. It does not replace them with values.

Creating a template

Name the context ID, the language, the subject and the body. If one of them is missing, the agent asks for it.

Create an English template with the context ID shift-report, the subject "Shift report {{.shift}}" and the body "Hello {{.name}}, the report for shift {{.shift}} is ready.".

A new template is only used when notifications with this context ID are sent, for example by your own application. See Email notification API.

Deleting a template

Delete the English template shift-report.

The agent asks for confirmation before it deletes a template.

If you delete a template that is in use, for example cm-rule-triggered, no emails can be sent for this purpose and language.

E-Mail-Vorlagen

Eine Vorlage legt Betreff und Nachrichtentext einer E-Mail für einen Zweck und eine Sprache fest. Vorlagen werden mit dem Agenten angezeigt und geändert.

Voraussetzung

  • Berechtigung ai_chat:read, um den Agenten zu nutzen

  • Berechtigung templates:read, um Vorlagen zu sehen

  • Berechtigung templates:write, um Vorlagen anzulegen und zu ändern

  • Berechtigung templates:delete, um Vorlagen zu löschen

Felder einer Vorlage

Feld Beschreibung

Kontext-ID

Zweck der Vorlage, zum Beispiel cm-rule-triggered für Regelereignisse. Das Smart Operations Toolkit wählt die Vorlage anhand dieser ID aus.

Sprache

en (Englisch) oder de (Deutsch). Jede Kontext-ID kann eine Vorlage je Sprache haben.

Betreff

Betreff der E-Mail. Kann Platzhalter enthalten.

Nachrichtentext

Text der E-Mail. Kann Platzhalter enthalten.

Herkunft

Default für Vorlagen, die mit dem Smart Operations Toolkit ausgeliefert werden, Custom für Vorlagen, die die Organisation angelegt hat.

Kontext-ID und Sprache einer Vorlage lassen sich nach dem Anlegen der Vorlage nicht mehr ändern.

Platzhalter

Platzhalter stehen in doppelten geschweiften Klammern mit einem führenden Punkt, zum Beispiel {{.device}}. Beim Senden der E-Mail wird der Platzhalter durch seinen Wert ersetzt. Auch Bedingungen sind möglich, zum Beispiel {{if .name}}Hello {{.name}},{{end}}.

Platzhalter der Vorlage für Regelereignisse

Die Vorlage cm-rule-triggered gibt es auf Englisch und auf Deutsch.

Platzhalter Inhalt

{{.severity}}

Schweregrad des Ereignisses, zum Beispiel Warnung

{{.ruleName}}

Name der Regel

{{.device}}

Gerät, an dem die Regel ausgelöst wurde

{{.measuringPoint}}

Überwachter Messpunkt

{{.time}}

Zeitpunkt, zu dem die Regel ausgelöst wurde

{{.triggeredValue}}

Wert, der die Regel ausgelöst hat

{{.ruleParams}}

Parameter der Regel, zum Beispiel die Schwellenwerte (optional)

{{.name}}

Name des Empfängers (optional)

Vorlagen anzeigen

Den Agenten fragen, zum Beispiel:

Welche Benachrichtigungsvorlagen gibt es?
Zeige die englische Vorlage cm-rule-triggered.
E-Mail-Vorlagen

Vorlage ändern

  1. Den Agenten fragen, zum Beispiel:

    Ändere den Betreff der englischen Vorlage cm-rule-triggered in "{{.severity}}: {{.ruleName}} on {{.device}} ({{.measuringPoint}})".
  2. Die vom Agenten angezeigte Änderung prüfen und bestätigen.

Die Vorlage ist geändert. Die nächsten E-Mails verwenden den neuen Text.

Der Agent übernimmt die Platzhalter exakt so, wie sie eingegeben werden. Er ersetzt sie nicht durch Werte.

Vorlage anlegen

Kontext-ID, Sprache, Betreff und Nachrichtentext nennen. Fehlt eine Angabe, fragt der Agent nach.

Lege eine englische Vorlage mit der Kontext-ID shift-report, dem Betreff "Shift report {{.shift}}" und dem Nachrichtentext "Hello {{.name}}, the report for shift {{.shift}} is ready." an.

Eine neue Vorlage wird nur verwendet, wenn Benachrichtigungen mit dieser Kontext-ID gesendet werden, zum Beispiel von einer eigenen Anwendung. Siehe API für E-Mail-Benachrichtigungen.

Vorlage löschen

Lösche die englische Vorlage shift-report.

Der Agent bittet um Bestätigung, bevor er eine Vorlage löscht.

Wird eine verwendete Vorlage gelöscht, zum Beispiel cm-rule-triggered, lassen sich für diesen Zweck und diese Sprache keine E-Mails mehr senden.
Diese Seite bearbeiten Edit this page

Feedback on this pageFeedback zu dieser Seite