All Products
Search
Document Center

Cloud Monitor:Notification templates

Last Updated:Mar 26, 2026

Create custom notification templates to send alert notifications to alert contacts via phone, SMS, email, DingTalk, WeCom, Lark, Slack, or webhooks. You can use variables to customize the content in both Chinese and English.

Create a notification template

This section demonstrates how to create a notification template, using an email template as an example.

  1. Log on to the Cloud Monitor 2.0 console, select the target workspace, and in the left-side navigation pane, navigate to Alert center > Notification management > Notification template.

  2. Click Create notification template.

  3. In the Create/edit notification template panel, configure the following parameters.

    Parameter

    Description

    Template name

    Required. The name of the notification template. Use a descriptive name for easy identification and management.

    Template ID

    Required. The unique identifier for the notification template. This parameter cannot be modified after creation. Use a combination of letters, numbers, and underscores (_).

    Type

    Required. The delivery channel for the notification template. This parameter cannot be modified after creation. Valid values:

    - Phone: Voice call notifications with concise content.

    - SMS: Text message notifications with concise content.

    - Email: Supports HTML-formatted notifications. A Notification title is also required.

    - DingTalk: Notifications for DingTalk bots that support Markdown format.

    - WeCom: Notifications for WeCom bots that support Markdown format.

    - Lark: Notifications for Lark bots that support Markdown format.

    - Slack: Notifications for Slack bots that support Markdown format.

    - webhook: Custom webhook notifications that support Markdown format.

    Notification content

    Required. The notification content, which can be customized with variables. You must configure both the Chinese template and the English template.

  4. Click OK.

Delete a template

  1. On the Notification template page, find the template you want to delete and click Delete in the Actions column.

  2. In the confirmation dialog box, click OK.

Warning

This action cannot be undone. Notification policies that use this template will fail to send notifications. Proceed with caution.

Template variables

Notification templates use Go template syntax. Use variables in the format {{ .VariableName }} to dynamically populate alert information.

Subscription and incident variables

Parameter

Description

{{ .subscription.name }}

The name of the notification policy.

{{ .incident.alertCount }}

The number of associated alert events.

{{ .incident.severity }}

The highest severity among the alert events.

{{ .incident.userId }}

The user ID.

{{ .incident.groupingKeys }}

The grouping key-value pairs (Map object).

Event detail variables

Iterate over .events to access the details of each alert event:

Parameter

Description

{{ .severity }}

The severity of the alert.

{{ .time }}

The time the alert was triggered.

{{ .sourcetype }}

The event type.

{{ .subject }}

The title of the alert.

{{ .labels }}

The labels of the alert.

{{ .annotations }}

The annotations of the alert.

{{ .resource.entity.domain }}

The domain of the alerting resource.

{{ .resource.entity.entityType }}

The entity type.

{{ .resource.entity.entityId }}

The entity ID.

{{ .resource.entity.prop }}

The properties of the alerting resource.

Template syntax examples

Iterate over grouping key-value pairs:

{{ range $key, $value := .incident.groupingKeys }}
>> {{ $key }} = {{ $value }}
{{ end }}

Iterate over alert events (limit to the first 3):

{{ range $index, $event := .events }}
{{ if lt $index 3 }}
>- Severity: {{ $event.severity }}
>- Time: {{ $event.time }}
>- Title: {{ $event.subject }}
{{ end }}
{{ end }}