All Products
Search
Document Center

:Direct Mail events

最終更新日:Aug 20, 2024

This topic describes the types of Direct Mail events that CloudMonitor monitors and can be published to EventBridge.

Supported regions

You can publish Direct Mail events to EventBridge in the following regions: China (Hangzhou), Germany (Frankfurt), Singapore, and US (Virginia).

Event types

The following table describes the types of Direct Mail events that can be published to EventBridge.

Event type

Value of the type parameter

An email fails to be sent

dm:Deliver:Fail

An email is sent

dm:Deliver:Succeed

An email is clicked

dm:Trace:Click

An email is opened

dm:Trace:Open

For more information about the parameters defined in the CloudEvents specification, see Overview.

An email fails to be sent

The following example shows the event that EventBridge receives when an email fails to be sent:

{
  "data": {
    "header": {
      "X-Notify-Message-ID": "test****@example.com"
    },
    "env_id": "60000****",
    "account": "batch****@top",
    "from": "batch****@top",
    "rcpt": "a****@aliyun.com",
    "msg_id": "1df****@example.com",
    "send_time": "2024-04-29T11:07:04+08:00",
    "deliver_time": "2024-04-29T11:07:12+08:00",
    "status": "2",
    "event": "dm:Deliver:Fail",
    "region": "cn-hangzhou",
    "err_code": "554",
    "err_msg": "554  RCPT a****@aliyun.com dosn't exist",
    "failed_type": "SmtpNxBox"
  },
  "id": "8734hhidu983h****",
  "source": "acs:dm",
  "specversion": "1.0",
  "subject": "acs:dm:cn-hangzhou:123456789098****:215672",
  "time": "2024-04-29T11:07:12+08:00",
  "type": "dm:Deliver:Fail",
  "aliyunaccountid": "123456789098****",
  "aliyunpublishtime": "2024-04-29T11:07:13.179PRC",
  "aliyuneventbusname": "default",
  "aliyunregionid": "cn-hangzhou",
  "aliyunpublishaddr": "172.25.XX.XX"
}

The following table describes the parameters contained in data.

Parameter

Type

Example

Description

header

Object

The header that is related to the email.

X-Notify-Message-ID

String

test****@example.com

The custom header X-Notify-Message-ID.

env_id

String

60000****

The ID of the email returned by the system when the email was sent.

account

String

batch****@top

The email address of the sender.

from

String

batch****@top

The email address of the sender.

rcpt

String

a****@aliyun.com

The email address of the recipient.

msg_id

String

1df****@example.com

The Message-ID field in the email.

send_time

String

2024-04-29T11:07:04+08:00

The time when the email was received.

deliver_time

String

2024-04-29T11:07:12+08:00

The time when the email was sent.

status

String

2

The sending result of the email. Valid values:

  • 0: The email was successfully sent.

  • 2: The email address is invalid.

  • 3: The recipient considers the email as a spam email.

  • 4: The email fails to be sent due to other reasons.

event

String

dm:Deliver:Fail

The type of the event message. The value is the same as the value of the type parameter.

region

String

cn-hangzhou

The region where the event occurred.

err_code

String

554

The code returned by Email Service Provider (ESP) after the email is sent.

err_msg

String

554 RCPT a****@aliyun.com dosn't exist

The information returned by ESP after the email is sent.

failed_type

String

SmtpNxBox

The type of the sending result.

An email is sent

The following example shows the event that EventBridge receives when an email is sent:

{
  "data": {
    "header": {
      "X-Notify-Message-ID": "test****@example.com"
    },
    "env_id": "60000****",
    "account": "batch****@top",
    "from": "batch****@top",
    "rcpt": "a****@aliyun.com",
    "msg_id": "1df****@example.com",
    "send_time": "2024-04-29T11:07:04+08:00",
    "deliver_time": "2024-04-29T11:07:12+08:00",
    "status": "0",
    "event": "dm:Deliver:Succeed",
    "region": "cn-hangzhou",
    "err_code": "250",
    "err_msg": "250 Send Mail OK",
    "failed_type": "SendOk"
  },
  "id": "8734hhidu983h****",
  "source": "acs:dm",
  "specversion": "1.0",
  "subject": "acs:dm:cn-hangzhou:123456789098****:215672",
  "time": "2024-04-29T11:07:12+08:00",
  "type": "dm:Deliver:Succeed",
  "aliyunaccountid": "123456789098****",
  "aliyunpublishtime": "2024-04-29T11:07:13.179PRC",
  "aliyuneventbusname": "default",
  "aliyunregionid": "cn-hangzhou",
  "aliyunpublishaddr": "172.25.XX.XX"
}

For information about the parameters in the data field, see the field description table.

An email is clicked

The following example shows the event that EventBridge receives when an email is clicked:

{
  "data": {
    "operate_time": "2024-04-29T11:25:48+08:00",
    "client_ip": "192.168.XX.XX",
    "env_id": "60000****",
    "from": "batch****@top",
    "rcpt": "a****@aliyun.com",
    "msg_id": "1df****@example.com",
    "event": "dm:Trace:Click",
    "region": "cn-hangzhou",
    "url": "https://www.aliyun.com"
  },
  "id": "8734hhidu983h****",
  "source": "acs:dm",
  "specversion": "1.0",
  "subject": "acs:dm:cn-hangzhou:123456789098****:215672",
  "time": "2024-04-29T11:07:12+08:00",
  "type": "dm:Trace:Click",
  "aliyunaccountid": "123456789098****",
  "aliyunpublishtime": "2024-04-29T11:07:13.179PRC",
  "aliyuneventbusname": "default",
  "aliyunregionid": "cn-hangzhou",
  "aliyunpublishaddr": "172.25.XX.XX"
}

The following table describes the parameters contained in data.

Parameter

Type

Example

Description

operate_time

String

2024-04-29T11:25:48+08:00

The time when the email was clicked.

client_ip

String

192.168.XX.XX

The IP address of the client on which the email was clicked.

env_id

String

60000******

The ID of the email returned by the system when the email was sent.

from

String

batch****@top

The email address of the sender.

rcpt

String

a****@aliyun.com

The email address of the recipient.

msg_id

String

1df****@example.com

The Message-ID field in the email.

event

String

dm:Trace:Click

The type of the system event.

region

String

cn-hangzhou

The region where the event occurred.

url

String

https://www.aliyun.com

The URL through which the email was clicked.

An email is opened

The following example shows the event that EventBridge receives when an email is opened:

{
  "data": {
    "operate_time": "2024-04-29T11:25:48+08:00",
    "client_ip": "192.168.XX.XX",
    "env_id": "60000****",
    "from": "batch****@top",
    "rcpt": "a****@aliyun.com",
    "msg_id": "1df****@example.com",
    "event": "dm:Trace:Open",
    "region": "cn-hangzhou"
  },
  "id": "8734hhidu983h****",
  "source": "acs:dm",
  "specversion": "1.0",
  "subject": "acs:dm:cn-hangzhou:123456789098****:215672",
  "time": "2024-04-29T11:07:12+08:00",
  "type": "dm:Trace:Open",
  "aliyunaccountid": "123456789098****",
  "aliyunpublishtime": "2024-04-29T11:07:13.179PRC",
  "aliyuneventbusname": "default",
  "aliyunregionid": "cn-hangzhou",
  "aliyunpublishaddr": "172.25.XX.XX"
}

For information about the parameters in the data field, see the field description table.