NotifyMessage

更新时间:
复制 MD 格式

The NotifyMessage component sends event notifications.

Features

Actions

Description

Use cases

notifyByMessageCenter

Sends event notifications via Message Center. The message type is "Security Message - Cloud Security Information Notification".

Uses the notification methods configured in Message Center to send notifications for security event generation, security alert generation, and security event updates.

notifyByCustom

Sends custom event notifications.

Sends custom messages to email addresses and DingTalk groups.

Configuration example

This topic provides configuration examples for NotifyMessage actions, which you can import as test playbooks. Use the visualization flow editor to understand and test the configuration parameters for each action. This helps you quickly master the component's logic and usage. For import instructions, see Playbook import.

Note

Save the example data as a JSON file before you proceed.

Example data

{
    "cells": [
        {
            "position": {
                "x": -660, 
                "y": -170
            }, 
            "size": {
                "width": 36, 
                "height": 36
            }, 
            "attrs": {
                "body": {
                    "fill": "white", 
                    "strokeOpacity": 0.95, 
                    "stroke": "black", 
                    "strokeWidth": 2
                }, 
                "label": {
                    "text": "start", 
                    "fontSize": 12, 
                    "refX": 0.5, 
                    "refY": "100%", 
                    "refY2": 4, 
                    "textAnchor": "middle", 
                    "textVerticalAnchor": "top"
                }
            }, 
            "visible": true, 
            "shape": "circle", 
            "id": "58d87b7d-28d9-4f0e-b135-4adc4f1a70e4", 
            "zIndex": 1, 
            "data": {
                "nodeType": "startEvent", 
                "appType": "basic", 
                "nodeName": "start", 
                "icon": "icon-circle", 
                "description": "The start node of the playbook. A playbook must have one and only one start node. You must configure input data for the playbook."
            }, 
            "markup": [
                {
                    "tagName": "circle", 
                    "selector": "body"
                }, 
                {
                    "tagName": "text", 
                    "selector": "label"
                }
            ], 
            "isNode": true
        }, 
        {
            "shape": "custom-edge", 
            "zIndex": 1, 
            "id": "5293c3f9-e1c9-4a49-b0eb-635067dc67e8", 
            "data": {
                "nodeType": "sequenceFlow", 
                "appType": "basic", 
                "isRequired": true, 
                "icon": "icon-upper-right-arrow"
            }, 
            "isNode": false, 
            "source": {
                "cell": "58d87b7d-28d9-4f0e-b135-4adc4f1a70e4"
            }, 
            "target": {
                "cell": "88d3ff93-4f11-4d82-b43b-31dfd0530774"
            }, 
            "visible": true, 
            "router": {
                "name": "manhattan", 
                "args": {
                    "padding": 5, 
                    "excludeHiddenNodes": true, 
                    "excludeNodes": [
                        "clone_node_id"
                    ]
                }
            }, 
            "vertices": [ ]
        }, 
        {
            "position": {
                "x": -70, 
                "y": -170
            }, 
            "size": {
                "width": 36, 
                "height": 36
            }, 
            "attrs": {
                "body": {
                    "fill": "white", 
                    "strokeOpacity": 0.95, 
                    "stroke": "black", 
                    "strokeWidth": 2
                }, 
                "path": {
                    "r": 12, 
                    "refX": "50%", 
                    "refY": "50%", 
                    "fill": "black", 
                    "strokeOpacity": 0.95, 
                    "stroke": "black", 
                    "strokeWidth": 4
                }, 
                "label": {
                    "text": "end", 
                    "fontSize": 12, 
                    "refX": 0.5, 
                    "refY": "100%", 
                    "refY2": 4, 
                    "textAnchor": "middle", 
                    "textVerticalAnchor": "top"
                }
            }, 
            "visible": true, 
            "shape": "circle", 
            "id": "317dd1be-2d20-460e-977e-1fc936ffb583", 
            "zIndex": 1, 
            "data": {
                "nodeType": "endEvent", 
                "appType": "basic", 
                "nodeName": "end", 
                "icon": "icon-radio-off-full", 
                "description": "end"
            }, 
            "markup": [
                {
                    "tagName": "circle", 
                    "selector": "body"
                }, 
                {
                    "tagName": "circle", 
                    "selector": "path"
                }, 
                {
                    "tagName": "text", 
                    "selector": "label"
                }
            ], 
            "isNode": true
        }, 
        {
            "position": {
                "x": -551, 
                "y": -185
            }, 
            "size": {
                "width": 137, 
                "height": 66
            }, 
            "view": "react-shape-view", 
            "attrs": {
                "label": {
                    "text": "NotifyMessage_1"
                }
            }, 
            "shape": "activity", 
            "id": "88d3ff93-4f11-4d82-b43b-31dfd0530774", 
            "data": {
                "componentName": "NotifyMessage", 
                "appType": "component", 
                "nodeType": "action", 
                "icon": "https://img.alicdn.com/tfs/TB1mO0AeAL0gK0jSZFAXXcA9pXa-200-200.svg", 
                "ownType": "sys", 
                "zIndex": 1, 
                "tenantId": "baba", 
                "customInput": false, 
                "description": "The notification feature of Message Center.", 
                "id": 0, 
                "name": "notifyByMessageCenter", 
                "operateType": "general", 
                "output": [
                    {
                        "dataType": "String", 
                        "name": "message", 
                        "tags": ""
                    }, 
                    {
                        "dataType": "Boolean", 
                        "name": "status", 
                        "tags": ""
                    }
                ], 
                "parameters": [
                    {
                        "dataType": "String", 
                        "defaultValue": "", 
                        "description": "", 
                        "enDescription": "", 
                        "name": "aliuid", 
                        "needCascader": false, 
                        "required": true, 
                        "tags": ""
                    }, 
                    {
                        "dataType": "String", 
                        "defaultValue": "", 
                        "description": "If you do not select a channel, notifications are sent through all channels.", 
                        "enDescription": "", 
                        "formConfig": "{\"component\":\"Select\",\"options\":{\"selectMode\":\"pureSelect\",\"remote\":false,\"optionList\":[{\"label\":\"SMS\",\"value\":\"sms\"},{\"label\":\"Email\",\"value\":\"email\"},{\"label\":\"webhook\",\"value\":\"webhook\"},{\"label\":\"Internal Message\",\"value\":\"pmsg\"}],\"mode\":\"multiple\",\"labelKey\":\"label\",\"valueKey\":\"value\"}}", 
                        "name": "channelTypeList", 
                        "needCascader": false, 
                        "required": false, 
                        "tags": ""
                    }, 
                    {
                        "dataType": "String", 
                        "defaultValue": "", 
                        "description": "The ID of the message event.", 
                        "enDescription": "", 
                        "name": "eventId", 
                        "needCascader": false, 
                        "required": true, 
                        "tags": ""
                    }, 
                    {
                        "dataType": "String", 
                        "defaultValue": "", 
                        "description": "The parameter variables.", 
                        "enDescription": "", 
                        "name": "params", 
                        "needCascader": false, 
                        "required": false, 
                        "tags": ""
                    }, 
                    {
                        "dataType": "String", 
                        "defaultValue": "", 
                        "description": "The language of the console.", 
                        "enDescription": "", 
                        "name": "lang", 
                        "needCascader": false, 
                        "required": false, 
                        "tags": ""
                    }
                ], 
                "riskLevel": 2, 
                "nodeName": "NotifyMessage_1", 
                "actionName": "notifyByMessageCenter", 
                "actionDisplayName": "notifyByMessageCenter", 
                "cascaderValue": [ ], 
                "valueData": {
                    "lang": "en", 
                    "channelTypeList": [ ], 
                    "eventId": "yundun_soar_incident_generate", 
                    "aliuid": "1766xxxx", 
                    "params": "{\"incidentName\":\"Event Generation Test\",\"incidentID\":\"xxx\",\"startTime\":\"2025-02-03 00:00:00\"}"
                }
            }, 
            "zIndex": 1
        }, 
        {
            "shape": "custom-edge", 
            "zIndex": 1, 
            "id": "6444c559-f58d-4d0c-8fdc-6988af2f766d", 
            "data": {
                "nodeType": "sequenceFlow", 
                "appType": "basic", 
                "isRequired": true, 
                "icon": "icon-upper-right-arrow"
            }, 
            "isNode": false, 
            "visible": true, 
            "router": {
                "name": "manhattan", 
                "args": {
                    "padding": 5, 
                    "excludeHiddenNodes": true, 
                    "excludeNodes": [
                        "clone_node_id"
                    ]
                }
            }, 
            "source": {
                "cell": "88d3ff93-4f11-4d82-b43b-31dfd0530774"
            }, 
            "target": {
                "cell": "6e34b2ec-3ac4-4f4c-8d0a-3cbebb00bd64"
            }, 
            "vertices": [ ]
        }, 
        {
            "position": {
                "x": -329, 
                "y": -185
            }, 
            "size": {
                "width": 137, 
                "height": 66
            }, 
            "view": "react-shape-view", 
            "attrs": {
                "label": {
                    "text": "NotifyMessage_2"
                }
            }, 
            "shape": "activity", 
            "id": "6e34b2ec-3ac4-4f4c-8d0a-3cbebb00bd64", 
            "data": {
                "componentName": "NotifyMessage", 
                "appType": "component", 
                "nodeType": "action", 
                "icon": "https://img.alicdn.com/tfs/TB1mO0AeAL0gK0jSZFAXXcA9pXa-200-200.svg", 
                "ownType": "sys", 
                "zIndex": 1, 
                "tenantId": "baba", 
                "customInput": true, 
                "description": "Sends notifications by using DingTalk and email.", 
                "id": 0, 
                "name": "notifyByCustom", 
                "operateType": "general", 
                "output": [
                    {
                        "dataType": "String", 
                        "name": "message"
                    }, 
                    {
                        "dataType": "Boolean", 
                        "name": "status"
                    }
                ], 
                "parameters": [
                    {
                        "dataType": "String", 
                        "defaultValue": "", 
                        "description": "", 
                        "name": "emailTitle", 
                        "needCascader": false, 
                        "required": false
                    }, 
                    {
                        "dataType": "String", 
                        "defaultValue": "", 
                        "description": "", 
                        "name": "receivers", 
                        "needCascader": false, 
                        "required": false
                    }, 
                    {
                        "dataType": "String", 
                        "defaultValue": "", 
                        "description": "", 
                        "name": "telephone", 
                        "needCascader": false, 
                        "required": false
                    }, 
                    {
                        "dataType": "String", 
                        "defaultValue": "", 
                        "description": "", 
                        "name": "telephonecontext", 
                        "needCascader": false, 
                        "required": false
                    }, 
                    {
                        "dataType": "String", 
                        "defaultValue": "", 
                        "description": "", 
                        "name": "dingding", 
                        "needCascader": false, 
                        "required": false
                    }, 
                    {
                        "dataType": "String", 
                        "defaultValue": "", 
                        "description": "", 
                        "name": "dingdingcontext", 
                        "needCascader": false, 
                        "required": false
                    }, 
                    {
                        "dataType": "String", 
                        "defaultValue": "", 
                        "description": "", 
                        "name": "sms", 
                        "needCascader": false, 
                        "required": false
                    }, 
                    {
                        "dataType": "String", 
                        "defaultValue": "", 
                        "description": "", 
                        "name": "smscontext", 
                        "needCascader": false, 
                        "required": false
                    }, 
                    {
                        "dataType": "String", 
                        "defaultValue": "", 
                        "description": "", 
                        "name": "email", 
                        "needCascader": false, 
                        "required": false
                    }, 
                    {
                        "dataType": "String", 
                        "defaultValue": "", 
                        "description": "", 
                        "name": "emailcontext", 
                        "needCascader": false, 
                        "required": false
                    }, 
                    {
                        "dataType": "String", 
                        "defaultValue": "", 
                        "description": "", 
                        "name": "customReceiver", 
                        "needCascader": false, 
                        "required": false
                    }, 
                    {
                        "dataType": "String", 
                        "defaultValue": "", 
                        "description": "", 
                        "name": "jsonInput", 
                        "needCascader": false, 
                        "required": false
                    }, 
                    {
                        "dataType": "String", 
                        "defaultValue": "", 
                        "description": "", 
                        "name": "dingdingWebhooks", 
                        "needCascader": false, 
                        "required": false
                    }, 
                    {
                        "dataType": "String", 
                        "defaultValue": "", 
                        "description": "", 
                        "name": "dingdingMsgType", 
                        "needCascader": false, 
                        "required": false
                    }
                ], 
                "riskLevel": 2, 
                "nodeName": "NotifyMessage_2", 
                "actionName": "notifyByCustom", 
                "actionDisplayName": "notifyByCustom", 
                "cascaderValue": [
                    {
                        "label": "NotifyMessage_1", 
                        "value": "${NotifyMessage_1}", 
                        "children": [ ]
                    }
                ], 
                "assetUuid": "acde2ae8-8b01-4bec-97c4-44ba6c9ba457", 
                "valueData": {
                    "email": 1, 
                    "receivers": "[{\"userid\":-1,\"email\":\"xxx@163.com\"}]", 
                    "emailTitle": "Custom Notification Test", 
                    "emailcontext": "Custom Notification Test"
                }
            }, 
            "zIndex": 1
        }, 
        {
            "shape": "custom-edge", 
            "zIndex": 1, 
            "id": "5f2bddfd-ae71-423e-ac59-e4dde4a45238", 
            "data": {
                "nodeType": "sequenceFlow", 
                "appType": "basic", 
                "isRequired": true, 
                "icon": "icon-upper-right-arrow"
            }, 
            "isNode": false, 
            "visible": true, 
            "router": {
                "name": "manhattan", 
                "args": {
                    "padding": 5, 
                    "excludeHiddenNodes": true, 
                    "excludeNodes": [
                        "clone_node_id"
                    ]
                }
            }, 
            "source": {
                "cell": "6e34b2ec-3ac4-4f4c-8d0a-3cbebb00bd64"
            }, 
            "target": {
                "cell": "317dd1be-2d20-460e-977e-1fc936ffb583"
            }, 
            "vertices": [ ]
        }
    ]
}

Resource instance configuration

To use the NotifyMessage component, first configure the email settings:

  1. Click the component. On the Basic Information Configuration tab, in the Resource instance configuration area, click Resource instance configuration.

  2. On the Resource instance configuration page, click Add and configure the parameters as shown in the following table.

Parameter

Description

assetname

A custom name for the resource instance.

emailSendServer

The SMTP server. This parameter is optional.

  • If you leave this parameter empty, the system infers the server from the domain of the emailUsername address.

    For example, if the sender email address is 1*@aliyun.com, the SMTP server is inferred as smtp.aliyun.com and the port is 465.

  • If you specify this parameter, use the "host:port" format. The host is required, and the port is optional, defaulting to 465.

    Note

    Alibaba Cloud security controls block port 25, so it is not supported. Port 465 is recommended.

emailUsername

The sender's email address.

Important
  • Only QQ Mail, NetEase Mail, Gmail, and Alibaba Mail are supported.

  • Only SMTP is supported for sending emails.

emailPassword

The password for the sender's email address.

Important

If authorization is enabled for your email account, enter the authorization code. Authorization codes expire and must be replaced before their expiration date. Otherwise, authentication will fail, and the component will be unable to send emails.

notifyByMessageCenter

Sends event notifications via Message Center. The message type is "Security Message - Cloud Security Information Notification".

Parameters

Parameter

Description

Notification method

This parameter is optional. You can select multiple methods.

  • If you do not set this parameter, the component sends notifications by using the methods configured in Message Center > Message Receiving Management.

  • If you set this parameter, notifications are sent using the intersection of the methods specified for this component and those configured in Message Center > Message Receiving Management.

For example, if you specify internal message and email for the component, but you specify email and webhook in Message Center, notifications are sent only by email.

Notification template

The following templates are supported: event generation, alert generation, and event update.

Note

The notification template contains variables that are replaced with actual values when the component sends a notification.

Parameter settings

Configure actual values for the variables defined in the notification template. You can specify constants or output parameters from a preceding node, such as ${event._tenant_id}.

notifyByCustom

Sends custom messages. Email and DingTalk groups are supported.

Email parameters

Parameter

Description

Sender

The sender's email address. This must be configured in the resource instance.

Recipient

The recipient's email address.

Subject

The email subject.

Body

The email body.

DingTalk parameters

Parameter

Description

Webhook

The destination webhook URL for messages. You can manage webhook URLs in Message Center.

Message template

The message template.