你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Azure 通信服务 - 电子邮件事件

本文提供了通信服务电子邮件事件的属性和架构。  有关事件架构的简介,请参阅 Azure 事件网格事件架构

事件类型

Azure 通信服务发出以下电话服务和短信事件类型:

事件类型 说明
Microsoft.Communication.EmailDeliveryReportReceived 当收到通信服务发送的电子邮件的传递报告时发布。
Microsoft.Communication.EmailEngagementTrackingReportReceived 在打开发送的电子邮件或单击链接(如果适用)时发布。

事件响应

触发某个事件后,事件网格服务会将有关该事件的数据发送到订阅终结点。

本部分包含一个示例,介绍每个事件的数据外观。

Microsoft.Communication.EmailDeliveryReportReceived event

[{
  "id": "00000000-0000-0000-0000-000000000000",
  "topic": "/subscriptions/{subscription-id}/resourceGroups/{group-name}/providers/microsoft.communication/communicationservices/{communication-services-resource-name}",
  "subject": "sender/senderid@azure.com/message/00000000-0000-0000-0000-000000000000",
  "data": {
    "sender": "senderid@azure.com", 
    "recipient": "receiver@azure.com",
    "messageId": "00000000-0000-0000-0000-000000000000",
    "status": "Delivered",
    "deliveryStatusDetails": {
      "statusMessage": "Status Message"
    },
    "deliveryAttemptTimeStamp": "2020-09-18T00:22:20.2855749+00:00",
  },
  "eventType": "Microsoft.Communication.EmailDeliveryReportReceived",
  "dataVersion": "1.0",
  "metadataVersion": "1",
  "eventTime": "2020-09-18T00:22:20.822Z"
}]

注意

Status 的可能值包括:

  • Delivered:邮件已成功传递到目标位置(收件人邮件传输代理)。
  • Suppressed:相应收件人的电子邮件之前已硬退回,因此,发送给此收件人的所有后续电子邮件将被暂时禁止。
  • Bounced:电子邮件已硬退回,这可能是因为电子邮件地址不存在或域无效。
  • Quarantined:邮件被隔离(作为垃圾邮件、批量邮件或网络钓鱼)。
  • FilteredSpam:邮件被标识为垃圾邮件,并且被拒绝或阻止(未隔离)。
  • Expanded:通讯组收件人在邮件传递到该组的各个成员之前已展开。
  • Failed:邮件未送达。

Microsoft.Communication.EmailEngagementTrackingReportReceived event

[{
  "id": "00000000-0000-0000-0000-000000000000",
  "topic": "/subscriptions/{subscription-id}/resourceGroups/{group-name}/providers/microsoft.communication/communicationservices/{communication-services-resource-name}",
  "subject": "sender/senderid@azure.com/message/00000000-0000-0000-0000-000000000000",
  "data": {
    "sender": "senderid@azure.com", 
    "messageId": "00000000-0000-0000-0000-000000000000",
    "userActionTimeStamp": "2022-09-06T22:34:52.1303595+00:00",
    "engagementContext": "",
    "userAgent": "",
    "engagementType": "view"
  },
  "eventType": "Microsoft.Communication.EmailEngagementTrackingReportReceived",
  "dataVersion": "1.0",
  "metadataVersion": "1",
  "eventTime": "2022-09-06T22:34:52.688Z"
}]

注意

engagementType 的可能值为:ViewClick。 当 engagementTypeClick 时,engagementContext 是发送的电子邮件中的被单击的链接。

教程

有关演示如何使用 Webhook 订阅电子邮件事件的教程,请参阅快速入门:处理电子邮件事件