

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 使用 Amazon SES 事件数据
<a name="working-with-event-data"></a>

您[设置事件发布](monitor-sending-using-event-publishing-setup.md)并为发送的电子邮件指定配置集后，可以从您在设置与电子邮件关联的配置集时指定的事件目标检索电子邮件发送事件。

本节介绍如何从 Amazon CloudWatch 和 Amazon Data Firehose 检索电子邮件发送事件，以及如何解释 Amazon SNS 提供的事件数据。
+ [正在从中检索 Amazon SES 事件数据 CloudWatch](event-publishing-retrieving-cloudwatch.md)
+ [从 Firehose 检索 Amazon SES 事件数据](event-publishing-retrieving-firehose.md)
+ [解释来自 Amazon SNS 的 Amazon SES 事件数据](event-publishing-retrieving-sns.md)

# 正在从中检索 Amazon SES 事件数据 CloudWatch
<a name="event-publishing-retrieving-cloudwatch"></a>

Amazon SES 可以发布您向亚马逊发送电子邮件事件的指标 CloudWatch。当您将事件数据发布到时 CloudWatch，它会将这些指标作为一组有序的时间序列数据提供。您可以使用这些指标来监控您的电子邮件发送的性能。例如，您可以监控投诉指标并设置 CloudWatch 警报，使其在指标超过特定值时触发。

Amazon SES 可以在两个级别上将这些事件发布到 CloudWatch：
+ **在您的 AWS 账户** — 这些粗略指标与您使用 Amazon SES 控制台和 `GetSendStatistics` API 监控的指标相对应，是您的整个指标的总和。 AWS 账户 Amazon SES CloudWatch 会自动将这些指标发布到。
+ **精细** – 这些指标将按您使用*邮件标记*定义的电子邮件特征分类。要将这些指标发布到 CloudWatch，您必须使用[事件目标设置 CloudWatch 事件发布](monitor-sending-using-event-publishing-setup.md)[，并在发送电子邮件时指定配置集](event-publishing-send-email.md)。您也可以指定邮件标记或使用 Amazon SES 自动提供的 [auto-tags](monitor-using-event-publishing.md#event-publishing-how-works)。

此部分介绍可用指标以及如何在 CloudWatch 中查看这些指标。

## 可用指标
<a name="event-publishing-retrieving-cloudwatch-metrics"></a>

您可以将以下 Amazon SES 电子邮件发送指标发布到 CloudWatch：
+ **Send**（发送）– 发送请求成功，Amazon SES 将尝试将邮件发送到收件人的邮件服务器。（如果使用账户级别或全局抑制，SES 仍会将其计为发送，但会抑制送达。）
+ **RenderingFailure**— 由于模板渲染问题，电子邮件未发送。当模板数据丢失或模板参数与数据不匹配时，可能会发生此事件类型。（此事件类型仅在您使用 [https://docs.aws.amazon.com/ses/latest/APIReference/API_SendTemplatedEmail.html](https://docs.aws.amazon.com/ses/latest/APIReference/API_SendTemplatedEmail.html) 或 [https://docs.aws.amazon.com/ses/latest/APIReference/API_SendBulkTemplatedEmail.html](https://docs.aws.amazon.com/ses/latest/APIReference/API_SendBulkTemplatedEmail.html) API 操作发送电子邮件时发生。）
+ **Reject**（拒绝）– Amazon SES 已接受电子邮件，但确定它包含病毒，而未尝试将其发送到收件人的邮件服务器。
+ **Delivery**（送达）– Amazon SES 成功将电子邮件发送到收件人的邮件服务器。
+ **退信** – 收件人的邮件服务器永久拒绝了电子邮件的*硬退信*。（仅当 S *ES 不再尝试发送电子邮件时，才会包含软退件*。 通常，这些软退件表示投递失败，尽管在某些情况下，即使邮件成功到达收件人收件箱，也可以返回软退件。 这通常发生在收件人发送 out-of-office自动回复时。 在这篇 re [AWS : Post 文章](https://repost.aws/knowledge-center/ses-understand-soft-bounces)中了解有关软反弹的更多信息。）
+ **Complaint**（投诉）– 电子邮件已成功送达收件人的邮件服务器，但收件人将其标记为垃圾邮件。
+ **DeliveryDelay**— 由于出现临时问题，无法将电子邮件发送到收件人的邮件服务器。例如，当收件人的收件箱已满，或者当接收电子邮件服务器遇到临时问题时，可能会发生传送延迟。
+ **Subscription**（订阅）– 电子邮件已成功发送，但收件人通过单击电子邮件标头中的 `List-Unsubscribe` 或脚注中的 `Unsubscribe` 链接更新了订阅首选项。
+ **Open**（打开）– 收件人已收到邮件并在其电子邮件客户端中打开了邮件。
+ **Click**（单击）– 收件人单击了电子邮件中包含的一个或多个链接。

## 可用维度
<a name="event-publishing-retrieving-cloudwatch-dimensions"></a>

CloudWatch 使用您在向 Amazon SES 中的配置集添加 CloudWatch 事件目标时指定的维度名称。有关更多信息，请参阅 [为 CloudWatch 活动发布设置活动目的地](event-publishing-add-event-destination-cloudwatch.md)。

## 在 CloudWatch 控制台中查看 Amazon SES 指标
<a name="event-publishing-retrieving-cloudwatch-console"></a>

以下过程介绍如何使用 CloudWatch 控制台查看 Amazon SES 事件发布指标。

**使用 CloudWatch 控制台查看指标**

1. 登录 AWS 管理控制台 并打开 CloudWatch 控制台，网址为[https://console.aws.amazon.com/cloudwatch/](https://console.aws.amazon.com/cloudwatch/)。

1. 如果需要，可以更改区域。在导航栏中，选择您的 AWS 资源所在的区域。有关更多信息，请参阅[区域和端点](https://docs.aws.amazon.com/general/latest/gr/rande.html)。

1. 在导航窗格中，选择**所有指标**。

1. 在**指标**窗格中，选择 **SES**。

1. 选择要查看的指标。要查看精细[事件发布指标](monitor-using-event-publishing.md)，请选择在[设置 CloudWatch 事件目标](event-publishing-add-event-destination-cloudwatch.md)时指定的维度组合。要详细了解如何使用查看指标 CloudWatch，请参阅[使用 Amazon CloudWatch 指标](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/working_with_metrics.html)。

**要查看指标，请使用 AWS CLI**
+ 在命令提示符处输入下面的命令：

  ```
  1. aws cloudwatch list-metrics --namespace "AWS/SES"
  ```

# 从 Firehose 检索 Amazon SES 事件数据
<a name="event-publishing-retrieving-firehose"></a>

Amazon SES 将电子邮件发送事件作为 JSON 记录发布到 Firehose。然后，Firehose 会将记录发布到你在 Firehose 中设置传送流时选择的 AWS 服务目的地。有关设置 Firehose 传输流的更多信息，请参阅《Amazon Data Firehose Developer Guide》**中的 [Creating an Firehose Delivery Stream](https://docs.aws.amazon.com/firehose/latest/dev/basic-create.html)。

**Topics**
+ [Amazon SES 发布到 Firehose 的事件数据的内容](event-publishing-retrieving-firehose-contents.md)
+ [Amazon SES 发布到 Firehose 的事件数据的示例](event-publishing-retrieving-firehose-examples.md)

# Amazon SES 发布到 Firehose 的事件数据的内容
<a name="event-publishing-retrieving-firehose-contents"></a>

Amazon SES 以 JSON 格式将电子邮件发送事件记录发布到 Amazon Data Firehose。在将事件发布到 Firehose 时，Amazon SES 在每个 JSON 记录后跟一个换行符。

您可以在 [Amazon SES 发布到 Firehose 的事件数据的示例](event-publishing-retrieving-firehose-examples.md) 中找到所有这些通知类型的示例记录。

**Topics**
+ [顶级 JSON 对象](#event-publishing-retrieving-firehose-contents-top-level-json-object)
+ [邮件对象](#event-publishing-retrieving-firehose-contents-mail-object)
+ [退信对象](#event-publishing-retrieving-firehose-contents-bounce-object)
+ [投诉对象](#event-publishing-retrieving-firehose-contents-complaint-object)
+ [送达对象](#event-publishing-retrieving-firehose-contents-delivery-object)
+ [发送对象](#event-publishing-retrieving-firehose-contents-send-object)
+ [拒绝对象](#event-publishing-retrieving-firehose-contents-reject-object)
+ [打开对象](#event-publishing-retrieving-firehose-contents-open-object)
+ [单击对象](#event-publishing-retrieving-firehose-contents-click-object)
+ [呈现失败对象](#event-publishing-retrieving-firehose-contents-failure-object)
+ [DeliveryDelay 对象](#event-publishing-retrieving-firehose-delivery-delay-object)
+ [订阅对象](#event-publishing-retrieving-firehose-subscription-object)

## 顶级 JSON 对象
<a name="event-publishing-retrieving-firehose-contents-top-level-json-object"></a>

电子邮件发送事件记录中的顶级 JSON 对象包含以下字段。


| 字段名称 | 说明 | 
| --- | --- | 
|  `eventType`  |  一个描述事件类型的文本字符串。可能的值：`Bounce`、`Complaint`、`Delivery`、`Send`、`Reject`、`Open`、`Click`、`Rendering Failure`、`DeliveryDelay` 或 `Subscription`。 如果尚未[设置事件发布](monitor-sending-using-event-publishing-setup.md)，则此字段将命名为 `notificationType`。  | 
|  `mail`  |  JSON 对象，包含有关生成事件的电子邮件的信息。  | 
|  `bounce`  |  仅当 `eventType` 为 `Bounce` 时，此字段才存在。它包含有关退信的信息。  | 
|  `complaint`  |  仅当 `eventType` 为 `Complaint` 时，此字段才存在。它包含有关投诉的信息。  | 
|  `delivery`  |  仅当 `eventType` 为 `Delivery` 时，此字段才存在。它包含有关送达的信息。  | 
|  `send`  |  仅当 `eventType` 为 `Send` 时，此字段才存在。  | 
|  `reject`  |  仅当 `eventType` 为 `Reject` 时，此字段才存在。它包含有关拒绝的信息。  | 
|  `open`  |  仅当 `eventType` 为 `Open` 时，此字段才存在。它包含有关打开事件的信息。  | 
|  `click`  |  仅当 `eventType` 为 `Click` 时，此字段才存在。它包含有关点击事件的信息。  | 
| `failure` | 仅当 `eventType` 为 `Rendering Failure` 时，此字段才存在。它包含有关呈现失败事件的信息。 | 
|  `deliveryDelay`  |  仅当 `eventType` 为 `DeliveryDelay` 时，此字段才存在。它包含有关延迟送达电子邮件的信息。  | 
|  `subscription`  |  仅当 `eventType` 为 `Subscription` 时，此字段才存在。它包含有关订阅首选项的信息。  | 

## 邮件对象
<a name="event-publishing-retrieving-firehose-contents-mail-object"></a>

每个电子邮件发送事件记录都包含有关 `mail` 对象中的原始电子邮件的信息。包含有关 `mail` 对象的信息的 JSON 对象具有以下字段。


| 字段名称 | 说明 | 
| --- | --- | 
|  `timestamp`  |  发送消息的日期和时间， ISO8601 格式为 (*YYYY-MM--: mm: ss.sz DDThh*)。  | 
|  `messageId`  |  Amazon SES 分配给电子邮件的唯一 ID。Amazon SES 在您发送邮件时已向您返回此值。  此邮件 ID 已由 Amazon SES 分配。您可以在 `mail` 对象的 `headers` 和 `commonHeaders` 字段中找到原始电子邮件的邮件 ID。   | 
|  `source`  |  发送邮件的电子邮件地址（信封 MAIL FROM 地址）。  | 
|  `sourceArn`  |  已用于发送电子邮件的身份的 Amazon Resource Name（ARN）。在发送授权的情况下，`sourceArn` 是身份拥有者授权委托发件人用于发送电子邮件的身份的 ARN。有关发送授权的更多信息，请参阅[电子邮件身份验证方法使用发送授权](sending-authorization.md)。  | 
|  `sendingAccountId`  |  用于发送电子邮件的账户的账户 ID。 AWS 在发送授权的情况下，`sendingAccountId` 是委托发件人的账户 ID。  | 
|  `destination`  |  作为原始邮件的收件人的电子邮件地址的列表。  | 
|  `headersTruncated`  |  一个字符串，指定标头是否会在通知中被截断，如果标头大于 10 KB，则会发生截断。可能的值为 `true` 和 `false`。  | 
|  `headers`  |  电子邮件的原始标头的列表。列表中的每个标头均有一个 `name` 字段和一个 `value` 字段。  `headers` 字段内的任何邮件 ID 均来自您传递至 Amazon SES 的原始邮件。Amazon SES 随后分配给电子邮件的邮件 ID 位于 `messageId` 对象的 `mail` 字段中。   | 
|  `commonHeaders`  |  电子邮件的原始常用标头的映射。  `commonHeaders` 字段中的任何邮件 ID 是 Amazon SES 随后在 `mail` 对象的 `messageId` 字段中分配给邮件的邮件 ID。   | 
|  `tags`  |  与电子邮件关联的标签的列表。  | 

## 退信对象
<a name="event-publishing-retrieving-firehose-contents-bounce-object"></a>

包含有关 `Bounce` 事件的信息的 JSON 对象将始终具有以下字段。


| 字段名称 | 说明 | 
| --- | --- | 
|  `bounceType`  |  退信的类型，由 Amazon SES 确定。  | 
|  `bounceSubType`  |  退信的子类型，由 Amazon SES 确定。  | 
|  `bouncedRecipients`  |  包含已退回的原始邮件收件人相关信息的列表。  | 
|  `timestamp`  |  互联网服务提供商发送退回通知的日期和时间， ISO8601 格式为 (*YYYY-MM--: mm: ss.sz DDThh*)。  | 
|  `feedbackId`  |  退信的唯一 ID。  | 
|  `reportingMTA`  |  DSN 中的 `Reporting-MTA` 字段的值。这是尝试执行 DSN 所述的传输、中继或网关操作的 Message Transfer Authority（MTA）的值。  此字段仅在传输状态通知（DSN）附加到退信时显示。   | 

### 退信的收件人
<a name="event-publishing-retrieving-firehose-contents-bounced-recipients"></a>

退信事件可能与一个收件人或多个收件人有关。`bouncedRecipients` 字段包含一系列对象（与退信事件相关的每个收件人各有一个对象）并将始终包含以下字段。


| 字段名称 | 说明 | 
| --- | --- | 
|  `emailAddress`  |  收件人的电子邮件地址。如果 DSN 可用，这将是 DSN 中的 `Final-Recipient` 字段的值。  | 

（可选）如果 DSN 已附加到退信，则以下字段也可能存在。


| 字段名称 | 说明 | 
| --- | --- | 
|  `action`  |  DSN 中的 `Action` 字段的值。这表示报告 MTA 因尝试将邮件传输至此收件人而需执行的操作。  | 
|  `status`  |  DSN 中的 `Status` 字段的值。这是每个收件人与传输无关的状态代码，用于指示邮件的传输状态。  | 
|  `diagnosticCode`  |  报告 MTA 发放的状态代码。这是 DSN 中的 `Diagnostic-Code` 字段的值。此字段可能不在 DSN 中（因此也不在 JSON 中）。  | 

### 退信类型
<a name="event-publishing-retrieving-firehose-contents-bounce-types"></a>

每个退信事件都属于下表中所示的类型之一。

事件发布系统仅发布不再由 Amazon SES 重试的硬退信和软退信。收到标有 `Permanent` 的退信时，应从邮件列表中删除对应的电子邮件地址；您将来无法向这些地址发送邮件。当某封邮件被软退回若干次并且 Amazon SES 已停止尝试再次传送它之后，系统将向您发送 `Transient` 退信。您将来或许能够成功重新发送到最初导致了 `Transient` 退信的地址。


| bounceType | bounceSubType | 说明 | 
| --- | --- | --- | 
|  `Undetermined`  |  `Undetermined`  |  Amazon SES 无法确定特定的退信原因。  | 
|  `Permanent`  |  `General`  |  Amazon SES 收到了一封常规硬退信。如果您收到此类退信，您应从邮件列表中删除收件人的电子邮件地址。  | 
|  `Permanent`  |  `NoEmail`  |  Amazon SES 收到永久硬退信，因为目标电子邮件地址不存在。如果您收到此类退信，您应从邮件列表中删除收件人的电子邮件地址。  | 
|  `Permanent`  |  `Suppressed`  |  Amazon SES 已禁止发送邮件到此地址，因为该地址最近出现过做作为无效地址被退回的历史记录。要覆盖全局黑名单，请参阅 [使用 Amazon SES 账户级黑名单](sending-email-suppression-list.md)。  | 
| Permanent | OnAccountSuppressionList | Amazon SES 已禁止发送到此地址，因为该地址已被加入[账户级黑名单](sending-email-suppression-list.md)。这不计入您的跳出率指标。 | 
|  `Transient`  |  `General`  |  Amazon SES 收到常规退信。将来，您也许能够向该收件人成功发送电子邮件。  | 
|  `Transient`  |  `MailboxFull`  |  Amazon SES 收到邮箱完全退信。将来，您也许能够向该收件人成功发送电子邮件。  | 
|  `Transient`  |  `MessageTooLarge`  |  Amazon SES 收到消息太大退信。如果您减小邮件的大小，则也许能够向该收件人成功发送电子邮件。  | 
|  `Transient`  |  `CustomTimeoutExceeded`  |  Amazon SES 无法在电子邮件发件人指定的时间内成功传送电子邮件。*（退回消息将指定在定义的 TTL 内任何可能的传送尝试失败的原因。）*   | 
|  `Transient`  |  `ContentRejected`  |  Amazon SES 收到内容拒绝退信。如果您更改邮件的内容，则也许能够向该收件人成功发送电子邮件。  | 
|  `Transient`  |  `AttachmentRejected`  |  Amazon SES 收到附件拒绝退信。如果您删除或更改附件，则也许能够向该收件人成功发送电子邮件。  | 

## 投诉对象
<a name="event-publishing-retrieving-firehose-contents-complaint-object"></a>

包含有关 `Complaint` 事件的信息的 JSON 对象具有以下字段。


| 字段名称 | 说明 | 
| --- | --- | 
|  `complainedRecipients`  |  包含可能已提交投诉的收件人的相关信息列表。  | 
|  `timestamp`  |  互联网服务提供商发送投诉通知的日期和时间， ISO8601 格式为 (*YYYY-MM--: mm: ss.sz DDThh*)。  | 
|  `feedbackId`  |  投诉的唯一 ID。  | 
|  `complaintSubType`  |  投诉的子类型，由 Amazon SES 确定。  | 

此外，如果反馈报告已附加到投诉，则以下字段也可能存在。


| 字段名称 | 说明 | 
| --- | --- | 
|  `userAgent`  |  反馈报告中的 `User-Agent` 字段的值。此值表示生成了报告的系统的名称和版本。  | 
|  `complaintFeedbackType`  |  从 ISP 收到的反馈报告中的 `Feedback-Type` 字段的值。此值包含反馈的类型。  | 
|  `arrivalDate`  |  反馈报告中`Arrival-Date`或`Received-Date`字段的值， ISO8601 格式为 (*YYYY-MM--*: mm: ss.sz)。DDThh此字段可能不在报告中（因此也不在 JSON 中）。  | 

### 已投诉的收件人
<a name="event-publishing-retrieving-firehose-contents-complained-recipients"></a>

`complainedRecipients` 字段包含可能已提交投诉的收件人的列表。

**重要**  
由于大多数 ISPs 人会从投诉通知中删除提交投诉的收件人的电子邮件地址，因此此列表包含有关可能发送投诉的收件人的信息，这些信息基于原始邮件的收件人和我们收到投诉的互联网服务提供商。Amazon SES 对原始邮件执行查找以确定此收件人列表。

此列表中的 JSON 对象包含以下字段。


| 字段名称 | 说明 | 
| --- | --- | 
|  `emailAddress`  |  收件人的电子邮件地址。  | 

### 投诉类型
<a name="event-publishing-retrieving-firehose-contents-complaint-types"></a>

根据`complaintFeedbackType`互联网编号分配机构网站[，您可在由报告 ISP 分配的 ](https://www.iana.org/assignments/marf-parameters/marf-parameters.xml#marf-parameters-2) 字段中看到以下投诉类型：


| 字段名称 | 说明 | 
| --- | --- | 
|  `abuse`  |  指示未经请求的电子邮件或某种其他类型的电子邮件滥用。  | 
|  `auth-failure`  |  电子邮件身份验证失败报告。  | 
|  `fraud`  |  指示某种欺诈或网络钓鱼活动。  | 
|  `not-spam`  |  指示提供报告的实体不会将邮件视为垃圾邮件。这可用于更正被错误地标记或分类为垃圾邮件的邮件。  | 
|  `other`  |  指示不适合其他已注册类型的任何其他反馈。  | 
|  `virus`  |  报告在原始邮件中发现病毒。  | 

## 送达对象
<a name="event-publishing-retrieving-firehose-contents-delivery-object"></a>

包含有关 `Delivery` 事件的信息的 JSON 对象将始终具有以下字段。


| 字段名称 | 说明 | 
| --- | --- | 
|  `timestamp`  |  Amazon SES 将电子邮件发送到收件人的邮件服务器的日期和时间， ISO8601 格式为 (*YYYY-MM--*: mm: ss.sz)。DDThh  | 
|  `processingTimeMillis`  |  从 Amazon SES 接受来自发件人的请求到 Amazon SES 将邮件传递到收件人的邮件服务器的时间（以毫秒为单位）。  | 
|  `recipients`  |  传送事件应用于的预定收件人的列表。  | 
|  `smtpResponse`  |  从 Amazon SES 接受电子邮件的远程 ISP 的 SMTP 响应消息。此消息因电子邮件、接收邮件服务器以及接收 ISP 而异。  | 
|  `reportingMTA`  |  发送邮件的 Amazon SES 邮件服务器的主机名。  | 
|  `remoteMtaIp`  |  Amazon SES 将电子邮件送达的 MTA 的 IP 地址。  | 

## 发送对象
<a name="event-publishing-retrieving-firehose-contents-send-object"></a>

包含有关 `send` 事件的信息的 JSON 对象始终为空。

## 拒绝对象
<a name="event-publishing-retrieving-firehose-contents-reject-object"></a>

包含有关 `Reject` 事件的信息的 JSON 对象将始终具有以下字段。


| 字段名称 | 说明 | 
| --- | --- | 
|  `reason`  |  电子邮件被拒绝的原因。唯一可能的值为 `Bad content`，这意味着 Amazon SES 检测到该电子邮件含有病毒。当某个邮件被拒绝时，Amazon SES 会停止处理该邮件，并且不会尝试将邮件发送到收件人的邮件服务器。  | 

## 打开对象
<a name="event-publishing-retrieving-firehose-contents-open-object"></a>

包含有关 `Open` 事件的信息的 JSON 对象将始终包含以下字段。


| 字段名称 | 说明 | 
| --- | --- | 
|  `ipAddress`  |  收件人的 IP 地址。  | 
|  `timestamp`  |  公开事件发生的日期和时间， ISO8601 格式为 (*YYYY-MM--*: mm: ss.sz)。DDThh  | 
|  `userAgent`  |  收件人用于打开电子邮件中的设备或电子邮件客户端的用户代理。  | 

## 单击对象
<a name="event-publishing-retrieving-firehose-contents-click-object"></a>

包含有关 `Click` 事件的信息的 JSON 对象将始终包含以下字段。


| 字段名称 | 说明 | 
| --- | --- | 
|  `ipAddress`  |  收件人的 IP 地址。  | 
|  `timestamp`  |  点击事件发生的日期和时间， ISO8601 格式为 (*YYYY-MM--*: mm: ss.sz)。DDThh  | 
|  `userAgent`  |  收件人单击电子邮件中链接时使用的客户端的用户代理。  | 
|  `link`  |  收件人点击的链接的 URL。  | 
|  `linkTags`  |  使用 `ses:tags` 属性添加到链接的标签的列表。有关向电子邮件中的链接添加标签的更多信息，请参阅 [Amazon SES 电子邮件发送指标 FAQs](faqs-metrics.md)中的[问题 5：我能否用唯一标识符来标记链接？](faqs-metrics.md#sending-metric-faqs-clicks-q5)。  | 

## 呈现失败对象
<a name="event-publishing-retrieving-firehose-contents-failure-object"></a>

包含有关 `Rendering Failure` 事件的信息的 JSON 对象具有以下字段。


| 字段名称 | 说明 | 
| --- | --- | 
|  `templateName`  |  用于发送电子邮件的模板的名称。  | 
|  `errorMessage`  |  提供有关呈现失败详细信息的消息。  | 

## DeliveryDelay 对象
<a name="event-publishing-retrieving-firehose-delivery-delay-object"></a>

包含有关 `DeliveryDelay` 事件的信息的 JSON 对象具有以下字段。


| 字段名称 | 说明 | 
| --- | --- | 
|  `delayType`  |  延迟的类型。可能的值有： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/ses/latest/dg/event-publishing-retrieving-firehose-contents.html)  | 
|  `delayedRecipients`  |  包含有关电子邮件收件人的信息的对象。  | 
|  `expirationTime`  |  Amazon SES 将停止尝试传输邮件的日期和时间。此值以 ISO 8601 格式显示。  | 
|  `reportingMTA`  |  报告延迟的邮件传输代理（MTA）的 IP 地址。  | 
|  `timestamp`  |  发生延迟的日期和时间，以 ISO 8601 格式显示。  | 

### 延迟的收件人
<a name="event-publishing-retrieving-firehose-contents-delivery-delay-object-recipients"></a>

`delayedRecipients` 对象包含以下值。


| 字段名称 | 说明 | 
| --- | --- | 
|  `emailAddress`  |  导致邮件送达延迟的电子邮件地址。  | 
|  `status`  |  与送达延迟关联的 SMTP 状态代码。  | 
|  `diagnosticCode`  |  接收邮件传输代理（MTA）提供的诊断代码。  | 

## 订阅对象
<a name="event-publishing-retrieving-firehose-subscription-object"></a>

包含有关 `Subscription` 事件的信息的 JSON 对象具有以下字段。


| 字段名称 | 说明 | 
| --- | --- | 
|  `contactList`  |  联系人所在的列表的名称。  | 
|  `timestamp`  |  ISP 发送订阅通知的日期和时间， ISO8601 格式为 *(YYYY-MM--: mm: ss.sz DDThh*)。  | 
|  `source`  |  发送邮件的电子邮件地址（信封 MAIL FROM 地址）。  | 
|  `newTopicPreferences`  |  一个 JSON 数据结构（映射），它指定联系人列表中所有主题的订阅状态，用于指示更改后的状态（联系人已订阅或已取消订阅）。  | 
|  `oldTopicPreferences`  |  一个 JSON 数据结构（映射），它指定联系人列表中所有主题的订阅状态，用于指示更改前的状态（联系人已订阅或已取消订阅）。  | 

### 新/旧主题首选项
<a name="event-publishing-retrieving-firehose-contents-subscription-object-topic-preferences"></a>

`newTopicPreferences` 和 `oldTopicPreferences` 对象包含以下值。


| 字段名称 | 说明 | 
| --- | --- | 
|  `unsubscribeAll`  |  指定联系人是否已取消订阅联系人列表中的所有主题。  | 
|  `topicSubscriptionStatus`  |  在 `topicName` 字段中指定主题的订阅状态，该字段指示该主题当前是否已订阅以接收来自 SES 的指定事件类型的通知。字段中可能的值为 **OptIn**（已订阅）或 **OptOut**（取消订阅）。`subscriptionStatus`  | 
|  `topicDefaultSubscriptionStatus`  |  在 `topicName` 字段中指定主题的默认订阅状态，以确定默认情况下是订阅还是取消订阅添加到事件目标的新主题。字段中可能的值为 **OptIn**（默认情况下已订阅）或 **OptOut**（默认取消订阅）。`subscriptionStatus`  | 

# Amazon SES 发布到 Firehose 的事件数据的示例
<a name="event-publishing-retrieving-firehose-examples"></a>

本节提供了一些示例，介绍 Amazon SES 发布到 Firehose 的电子邮件发送事件记录类型。

**Topics**
+ [退信记录](#event-publishing-retrieving-firehose-bounce)
+ [投诉记录](#event-publishing-retrieving-firehose-complaint)
+ [送达记录](#event-publishing-retrieving-firehose-delivery)
+ [发送记录](#event-publishing-retrieving-firehose-send)
+ [拒绝记录](#event-publishing-retrieving-firehose-reject)
+ [打开记录](#event-publishing-retrieving-firehose-open)
+ [单击记录](#event-publishing-retrieving-firehose-click)
+ [呈现失败记录](#event-publishing-retrieving-firehose-failure)
+ [DeliveryDelay 记录](#event-publishing-retrieving-firehose-delayed-delivery)
+ [订阅记录](#event-publishing-retrieving-firehose-subscription)

**注意**  
在以下使用 `tag` 字段的示例中，它使用通过配置集发布事件，而 SES 支持发布所有事件类型的标签。如果直接使用关于身份的反馈通知，则 SES 不会发布标签。阅读有关在[创建配置集](creating-configuration-sets.md)或[修改配置集](managing-configuration-sets.md#console-detail-configuration-sets)时添加标签的内容。

## 退信记录
<a name="event-publishing-retrieving-firehose-bounce"></a>

下面是 Amazon SES 发布到 Firehose 的 `Bounce` 事件记录的一个示例。

```
 1. {
 2.   "eventType":"Bounce",
 3.   "bounce":{
 4.     "bounceType":"Permanent",
 5.     "bounceSubType":"General",
 6.     "bouncedRecipients":[
 7.       {
 8.         "emailAddress":"recipient@example.com",
 9.         "action":"failed",
10.         "status":"5.1.1",
11.         "diagnosticCode":"smtp; 550 5.1.1 user unknown"
12.       }
13.     ],
14.     "timestamp":"2017-08-05T00:41:02.669Z",
15.     "feedbackId":"01000157c44f053b-61b59c11-9236-11e6-8f96-7be8aexample-000000",
16.     "reportingMTA":"dsn; mta.example.com"
17.   },
18.   "mail":{
19.     "timestamp":"2017-08-05T00:40:02.012Z",
20.     "source":"Sender Name <sender@example.com>",
21.     "sourceArn":"arn:aws:ses:us-east-1:123456789012:identity/sender@example.com",
22.     "sendingAccountId":"123456789012",
23.     "messageId":"EXAMPLE7c191be45-e9aedb9a-02f9-4d12-a87d-dd0099a07f8a-000000",
24.     "destination":[
25.       "recipient@example.com"
26.     ],
27.     "headersTruncated":false,
28.     "headers":[
29.       {
30.         "name":"From",
31.         "value":"Sender Name <sender@example.com>"
32.       },
33.       {
34.         "name":"To",
35.         "value":"recipient@example.com"
36.       },
37.       {
38.         "name":"Subject",
39.         "value":"Message sent from Amazon SES"
40.       },
41.       {
42.         "name":"MIME-Version",
43.         "value":"1.0"
44.       },
45.       {
46.         "name":"Content-Type",
47.         "value":"multipart/alternative; boundary=\"----=_Part_7307378_1629847660.1516840721503\""
48.       }
49.     ],
50.     "commonHeaders":{
51.       "from":[
52.         "Sender Name <sender@example.com>"
53.       ],
54.       "to":[
55.         "recipient@example.com"
56.       ],
57.       "messageId":"EXAMPLE7c191be45-e9aedb9a-02f9-4d12-a87d-dd0099a07f8a-000000",
58.       "subject":"Message sent from Amazon SES"
59.     },
60.     "tags":{
61.       "ses:configuration-set":[
62.         "ConfigSet"
63.       ],
64.       "ses:source-ip":[
65.         "192.0.2.0"
66.       ],
67.       "ses:from-domain":[
68.         "example.com"
69.       ],
70.       "ses:caller-identity":[
71.         "ses_user"
72.       ]
73.     }
74.   }
75. }
```

## 投诉记录
<a name="event-publishing-retrieving-firehose-complaint"></a>

下面是 Amazon SES 发布到 Firehose 的 `Complaint` 事件记录的一个示例。

```
 1. {
 2.   "eventType":"Complaint",
 3.   "complaint": {
 4.     "complainedRecipients":[
 5.       {
 6.         "emailAddress":"recipient@example.com"
 7.       }
 8.     ],
 9.     "timestamp":"2017-08-05T00:41:02.669Z",
10.     "feedbackId":"01000157c44f053b-61b59c11-9236-11e6-8f96-7be8aexample-000000",
11.     "userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36",
12.     "complaintFeedbackType":"abuse",
13.     "arrivalDate":"2017-08-05T00:41:02.669Z"
14.   },
15.   "mail":{
16.     "timestamp":"2017-08-05T00:40:01.123Z",
17.     "source":"Sender Name <sender@example.com>",
18.     "sourceArn":"arn:aws:ses:us-east-1:123456789012:identity/sender@example.com",
19.     "sendingAccountId":"123456789012",
20.     "messageId":"EXAMPLE7c191be45-e9aedb9a-02f9-4d12-a87d-dd0099a07f8a-000000",
21.     "destination":[
22.       "recipient@example.com"
23.     ],
24.     "headersTruncated":false,
25.     "headers":[
26.       {
27.         "name":"From",
28.         "value":"Sender Name <sender@example.com>"
29.       },
30.       {
31.         "name":"To",
32.         "value":"recipient@example.com"
33.       },
34.       {
35.         "name":"Subject",
36.         "value":"Message sent from Amazon SES"
37.       },
38.       {
39.         "name":"MIME-Version","value":"1.0"
40.       },
41.       {
42.         "name":"Content-Type",
43.         "value":"multipart/alternative; boundary=\"----=_Part_7298998_679725522.1516840859643\""
44.       }
45.     ],
46.     "commonHeaders":{
47.       "from":[
48.         "Sender Name <sender@example.com>"
49.       ],
50.       "to":[
51.         "recipient@example.com"
52.       ],
53.       "messageId":"EXAMPLE7c191be45-e9aedb9a-02f9-4d12-a87d-dd0099a07f8a-000000",
54.       "subject":"Message sent from Amazon SES"
55.     },
56.     "tags":{
57.       "ses:configuration-set":[
58.         "ConfigSet"
59.       ],
60.       "ses:source-ip":[
61.         "192.0.2.0"
62.       ],
63.       "ses:from-domain":[
64.         "example.com"
65.       ],
66.       "ses:caller-identity":[
67.         "ses_user"
68.       ]
69.     }
70.   }
71. }
```

## 送达记录
<a name="event-publishing-retrieving-firehose-delivery"></a>

下面是 Amazon SES 发布到 Firehose 的 `Delivery` 事件记录的一个示例。

```
 1. {
 2.   "eventType": "Delivery",
 3.   "mail": {
 4.     "timestamp": "2016-10-19T23:20:52.240Z",
 5.     "source": "sender@example.com",
 6.     "sourceArn": "arn:aws:ses:us-east-1:123456789012:identity/sender@example.com",
 7.     "sendingAccountId": "123456789012",
 8.     "messageId": "EXAMPLE7c191be45-e9aedb9a-02f9-4d12-a87d-dd0099a07f8a-000000",
 9.     "destination": [
10.       "recipient@example.com"
11.     ],
12.     "headersTruncated": false,
13.     "headers": [
14.       {
15.         "name": "From",
16.         "value": "sender@example.com"
17.       },
18.       {
19.         "name": "To",
20.         "value": "recipient@example.com"
21.       },
22.       {
23.         "name": "Subject",
24.         "value": "Message sent from Amazon SES"
25.       },
26.       {
27.         "name": "MIME-Version",
28.         "value": "1.0"
29.       },
30.       {
31.         "name": "Content-Type",
32.         "value": "text/html; charset=UTF-8"
33.       },
34.       {
35.         "name": "Content-Transfer-Encoding",
36.         "value": "7bit"
37.       }
38.     ],
39.     "commonHeaders": {
40.       "from": [
41.         "sender@example.com"
42.       ],
43.       "to": [
44.         "recipient@example.com"
45.       ],
46.       "messageId": "EXAMPLE7c191be45-e9aedb9a-02f9-4d12-a87d-dd0099a07f8a-000000",
47.       "subject": "Message sent from Amazon SES"
48.     },
49.     "tags": {
50.       "ses:configuration-set": [
51.         "ConfigSet"
52.       ],
53.       "ses:source-ip": [
54.         "192.0.2.0"
55.       ],
56.       "ses:from-domain": [
57.         "example.com"
58.       ],
59.       "ses:caller-identity": [
60.         "ses_user"
61.       ],
62.       "ses:outgoing-ip": [
63.         "192.0.2.0"
64.       ],
65.       "myCustomTag1": [
66.         "myCustomTagValue1"
67.       ],
68.       "myCustomTag2": [
69.         "myCustomTagValue2"
70.       ]      
71.     }
72.   },
73.   "delivery": {
74.     "timestamp": "2016-10-19T23:21:04.133Z",
75.     "processingTimeMillis": 11893,
76.     "recipients": [
77.       "recipient@example.com"
78.     ],
79.     "smtpResponse": "250 2.6.0 Message received",
80.     "remoteMtaIp": "123.456.789.012",
81.     "reportingMTA": "mta.example.com"
82.   }
83. }
```

## 发送记录
<a name="event-publishing-retrieving-firehose-send"></a>

下面是 Amazon SES 发布到 Firehose 的 `Send` 事件记录的一个示例。

```
 1. {
 2.   "eventType": "Send",
 3.   "mail": {
 4.     "timestamp": "2016-10-14T05:02:16.645Z",
 5.     "source": "sender@example.com",
 6.     "sourceArn": "arn:aws:ses:us-east-1:123456789012:identity/sender@example.com",
 7.     "sendingAccountId": "123456789012",
 8.     "messageId": "EXAMPLE7c191be45-e9aedb9a-02f9-4d12-a87d-dd0099a07f8a-000000",
 9.     "destination": [
10.       "recipient@example.com"
11.     ],
12.     "headersTruncated": false,
13.     "headers": [
14.       {
15.         "name": "From",
16.         "value": "sender@example.com"
17.       },
18.       {
19.         "name": "To",
20.         "value": "recipient@example.com"
21.       },
22.       {
23.         "name": "Subject",
24.         "value": "Message sent from Amazon SES"
25.       },
26.       {
27.         "name": "MIME-Version",
28.         "value": "1.0"
29.       },
30.       {
31.         "name": "Content-Type",
32.         "value": "multipart/mixed;  boundary=\"----=_Part_0_716996660.1476421336341\""
33.       },
34.       {
35.         "name": "X-SES-MESSAGE-TAGS",
36.         "value": "myCustomTag1=myCustomTagValue1, myCustomTag2=myCustomTagValue2"
37.       }
38.     ],
39.     "commonHeaders": {
40.       "from": [
41.         "sender@example.com"
42.       ],
43.       "to": [
44.         "recipient@example.com"
45.       ],
46.       "messageId": "EXAMPLE7c191be45-e9aedb9a-02f9-4d12-a87d-dd0099a07f8a-000000",
47.       "subject": "Message sent from Amazon SES"
48.     },
49.     "tags": {
50.       "ses:configuration-set": [
51.         "ConfigSet"
52.       ],
53.       "ses:source-ip": [
54.         "192.0.2.0"
55.       ],
56.       "ses:from-domain": [
57.         "example.com"
58.       ],      
59.       "ses:caller-identity": [
60.         "ses_user"
61.       ],
62.       "myCustomTag1": [
63.         "myCustomTagValue1"
64.       ],
65.       "myCustomTag2": [
66.         "myCustomTagValue2"
67.       ]      
68.     }
69.   },
70.   "send": {}
71. }
```

## 拒绝记录
<a name="event-publishing-retrieving-firehose-reject"></a>

下面是 Amazon SES 发布到 Firehose 的 `Reject` 事件记录的一个示例。

```
 1. {
 2.   "eventType": "Reject",
 3.   "mail": {
 4.     "timestamp": "2016-10-14T17:38:15.211Z",
 5.     "source": "sender@example.com",
 6.     "sourceArn": "arn:aws:ses:us-east-1:123456789012:identity/sender@example.com",
 7.     "sendingAccountId": "123456789012",
 8.     "messageId": "EXAMPLE7c191be45-e9aedb9a-02f9-4d12-a87d-dd0099a07f8a-000000",
 9.     "destination": [
10.       "sender@example.com"
11.     ],
12.     "headersTruncated": false,
13.     "headers": [
14.       {
15.         "name": "From",
16.         "value": "sender@example.com"
17.       },
18.       {
19.         "name": "To",
20.         "value": "recipient@example.com"
21.       },      
22.       {
23.         "name": "Subject",
24.         "value": "Message sent from Amazon SES"
25.       },
26.       {
27.         "name": "MIME-Version",
28.         "value": "1.0"
29.       },      
30.       {
31.         "name": "Content-Type",
32.         "value": "multipart/mixed; boundary=\"qMm9M+Fa2AknHoGS\""
33.       },
34.       {
35.         "name": "X-SES-MESSAGE-TAGS",
36.         "value": "myCustomTag1=myCustomTagValue1, myCustomTag2=myCustomTagValue2"
37.       }  
38.     ],
39.     "commonHeaders": {
40.       "from": [
41.         "sender@example.com"
42.       ],
43.       "to": [
44.         "recipient@example.com"
45.       ],
46.       "messageId": "EXAMPLE7c191be45-e9aedb9a-02f9-4d12-a87d-dd0099a07f8a-000000",
47.       "subject": "Message sent from Amazon SES"
48.     },
49.     "tags": {
50.       "ses:configuration-set": [
51.         "ConfigSet"
52.       ],
53.       "ses:source-ip": [
54.         "192.0.2.0"
55.       ],
56.       "ses:from-domain": [
57.         "example.com"
58.       ],    
59.       "ses:caller-identity": [
60.         "ses_user"
61.       ],
62.       "myCustomTag1": [
63.         "myCustomTagValue1"
64.       ],
65.       "myCustomTag2": [
66.         "myCustomTagValue2"
67.       ]      
68.     }
69.   },
70.   "reject": {
71.     "reason": "Bad content"
72.   }
73. }
```

## 打开记录
<a name="event-publishing-retrieving-firehose-open"></a>

下面是 Amazon SES 发布到 Firehose 的 `Open` 事件记录的一个示例。

```
 1. {
 2.   "eventType": "Open",
 3.   "mail": {
 4.     "commonHeaders": {
 5.       "from": [
 6.         "sender@example.com"
 7.       ],
 8.       "messageId": "EXAMPLE7c191be45-e9aedb9a-02f9-4d12-a87d-dd0099a07f8a-000000",
 9.       "subject": "Message sent from Amazon SES",
10.       "to": [
11.         "recipient@example.com"
12.       ]
13.     },
14.     "destination": [
15.       "recipient@example.com"
16.     ],
17.     "headers": [
18.       {
19.         "name": "X-SES-CONFIGURATION-SET",
20.         "value": "ConfigSet"
21.       },
22.       {
23.         "name":"X-SES-MESSAGE-TAGS",
24.         "value":"myCustomTag1=myCustomValue1, myCustomTag2=myCustomValue2"
25.       },
26.       {
27.         "name": "From",
28.         "value": "sender@example.com"
29.       },
30.       {
31.         "name": "To",
32.         "value": "recipient@example.com"
33.       },
34.       {
35.         "name": "Subject",
36.         "value": "Message sent from Amazon SES"
37.       },
38.       {
39.         "name": "MIME-Version",
40.         "value": "1.0"
41.       },
42.       {
43.         "name": "Content-Type",
44.         "value": "multipart/alternative; boundary=\"XBoundary\""
45.       }
46.     ],
47.     "headersTruncated": false,
48.     "messageId": "EXAMPLE7c191be45-e9aedb9a-02f9-4d12-a87d-dd0099a07f8a-000000",
49.     "sendingAccountId": "123456789012",
50.     "source": "sender@example.com",
51.     "tags": {
52.       "myCustomTag1":[
53.         "myCustomValue1"
54.       ],
55.       "myCustomTag2":[
56.         "myCustomValue2"
57.       ],
58.       "ses:caller-identity": [
59.         "IAM_user_or_role_name"
60.       ],
61.       "ses:configuration-set": [
62.         "ConfigSet"
63.       ],
64.       "ses:from-domain": [
65.         "example.com"
66.       ],
67.       "ses:source-ip": [
68.         "192.0.2.0"
69.       ]
70.     },
71.     "timestamp": "2017-08-09T21:59:49.927Z"
72.   },
73.   "open": {
74.     "ipAddress": "192.0.2.1",
75.     "timestamp": "2017-08-09T22:00:19.652Z",
76.     "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_3 like Mac OS X) AppleWebKit/603.3.8 (KHTML, like Gecko) Mobile/14G60"
77.   }
78. }
```

## 单击记录
<a name="event-publishing-retrieving-firehose-click"></a>

下面是 Amazon SES 发布到 Firehose 的 `Click` 事件记录的一个示例。

```
 1. {
 2.   "eventType": "Click",
 3.   "click": {
 4.     "ipAddress": "192.0.2.1",
 5.     "link": "http://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-email-smtp.html",
 6.     "linkTags": {
 7.       "samplekey0": [
 8.         "samplevalue0"
 9.       ],
10.       "samplekey1": [
11.         "samplevalue1"
12.       ]
13.     },
14.     "timestamp": "2017-08-09T23:51:25.570Z",
15.     "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36"
16.   },
17.   "mail": {
18.     "commonHeaders": {
19.       "from": [
20.         "sender@example.com"
21.       ],
22.       "messageId": "EXAMPLE7c191be45-e9aedb9a-02f9-4d12-a87d-dd0099a07f8a-000000",
23.       "subject": "Message sent from Amazon SES",
24.       "to": [
25.         "recipient@example.com"
26.       ]
27.     },
28.     "destination": [
29.       "recipient@example.com"
30.     ],
31.     "headers": [
32.       {
33.         "name": "X-SES-CONFIGURATION-SET",
34.         "value": "ConfigSet"
35.       },
36.       {
37.         "name":"X-SES-MESSAGE-TAGS",
38.         "value":"myCustomTag1=myCustomValue1, myCustomTag2=myCustomValue2"
39.       },
40.       {
41.         "name": "From",
42.         "value": "sender@example.com"
43.       },
44.       {
45.         "name": "To",
46.         "value": "recipient@example.com"
47.       },
48.       {
49.         "name": "Subject",
50.         "value": "Message sent from Amazon SES"
51.       },
52.       {
53.         "name": "MIME-Version",
54.         "value": "1.0"
55.       },
56.       {
57.         "name": "Content-Type",
58.         "value": "multipart/alternative; boundary=\"XBoundary\""
59.       },
60.       {
61.         "name": "Message-ID",
62.         "value": "EXAMPLE7c191be45-e9aedb9a-02f9-4d12-a87d-dd0099a07f8a-000000"
63.       }
64.     ],
65.     "headersTruncated": false,
66.     "messageId": "EXAMPLE7c191be45-e9aedb9a-02f9-4d12-a87d-dd0099a07f8a-000000",
67.     "sendingAccountId": "123456789012",
68.     "source": "sender@example.com",
69.     "tags": {
70.       "myCustomTag1":[
71.         "myCustomValue1"
72.       ],
73.       "myCustomTag2":[
74.         "myCustomValue2"
75.       ],
76.       "ses:caller-identity": [
77.         "ses_user"
78.       ],
79.       "ses:configuration-set": [
80.         "ConfigSet"
81.       ],
82.       "ses:from-domain": [
83.         "example.com"
84.       ],
85.       "ses:source-ip": [
86.         "192.0.2.0"
87.       ]
88.     },
89.     "timestamp": "2017-08-09T23:50:05.795Z"
90.   }
91. }
```

## 呈现失败记录
<a name="event-publishing-retrieving-firehose-failure"></a>

下面是 Amazon SES 发布到 Firehose 的 `Rendering Failure` 事件记录的一个示例。

```
 1. {
 2.   "eventType":"Rendering Failure",
 3.   "mail":{
 4.     "timestamp":"2018-01-22T18:43:06.197Z",
 5.     "source":"sender@example.com",
 6.     "sourceArn":"arn:aws:ses:us-east-1:123456789012:identity/sender@example.com",
 7.     "sendingAccountId":"123456789012",
 8.     "messageId":"EXAMPLE7c191be45-e9aedb9a-02f9-4d12-a87d-dd0099a07f8a-000000",
 9.     "destination":[
10.       "recipient@example.com"
11.     ],
12.     "headersTruncated":false,
13.     "tags":{
14.       "ses:configuration-set":[
15.         "ConfigSet"
16.       ]
17.     }
18.   },
19.   "failure":{
20.     "errorMessage":"Attribute 'attributeName' is not present in the rendering data.",
21.     "templateName":"MyTemplate"
22.   }
23. }
```

## DeliveryDelay 记录
<a name="event-publishing-retrieving-firehose-delayed-delivery"></a>

下面是 Amazon SES 发布到 Firehose 的 `DeliveryDelay` 事件记录的一个示例。

```
 1. {
 2.   "eventType": "DeliveryDelay",
 3.   "mail":{
 4.     "timestamp":"2020-06-16T00:15:40.641Z",
 5.     "source":"sender@example.com",
 6.     "sourceArn":"arn:aws:ses:us-east-1:123456789012:identity/sender@example.com",
 7.     "sendingAccountId":"123456789012",
 8.     "messageId":"EXAMPLE7c191be45-e9aedb9a-02f9-4d12-a87d-dd0099a07f8a-000000",
 9.     "destination":[
10.       "recipient@example.com"
11.     ],
12.     "headersTruncated":false,
13.     "tags":{
14.       "ses:configuration-set":[
15.         "ConfigSet"
16.       ]
17.     }
18.   },
19.   "deliveryDelay": {
20.     "timestamp": "2020-06-16T00:25:40.095Z",
21.     "delayType": "TransientCommunicationFailure",
22.     "expirationTime": "2020-06-16T00:25:40.914Z",
23.     "delayedRecipients": [{
24.       "emailAddress": "recipient@example.com",
25.       "status": "4.4.1",
26.       "diagnosticCode": "smtp; 421 4.4.1 Unable to connect to remote host"
27.     }]
28.   }
29. }
```

## 订阅记录
<a name="event-publishing-retrieving-firehose-subscription"></a>

下面是 Amazon SES 发布到 Firehose 的 `Subscription` 事件记录的一个示例。

```
 1. {
 2.   "eventType": "Subscription",
 3.   "mail": {
 4.     "timestamp": "2022-01-12T01:00:14.340Z",
 5.     "source": "sender@example.com",
 6.     "sourceArn": "arn:aws:ses:us-east-1:123456789012:identity/sender@example.com",
 7.     "sendingAccountId": "123456789012",
 8.     "messageId": "EXAMPLEe4bccb684-777bc8de-afa7-4970-92b0-f515137b1497-000000",
 9.     "destination": ["recipient@example.com"],
10.     "headersTruncated": false,
11.     "headers": [
12.       {
13.         "name": "From",
14.         "value": "sender@example.com"
15.       },
16.       {
17.         "name": "To",
18.         "value": "recipient@example.com"
19.       },
20.       {
21.         "name": "Subject",
22.         "value": "Message sent from Amazon SES"
23.       },
24.       {
25.         "name": "MIME-Version",
26.         "value": "1.0"
27.       },
28.       {
29.         "name": "Content-Type",
30.         "value": "text/html; charset=UTF-8"
31.       },
32.       {
33.         "name": "Content-Transfer-Encoding",
34.         "value": "7bit"
35.       }
36.     ],
37.     "commonHeaders": {
38.       "from": ["sender@example.com"],
39.       "to": ["recipient@example.com"],
40.       "messageId": "EXAMPLEe4bccb684-777bc8de-afa7-4970-92b0-f515137b1497-000000",
41.       "subject": "Message sent from Amazon SES"
42.     },
43.     "tags": {
44.       "ses:operation": ["SendEmail"],
45.       "ses:configuration-set": ["ConfigSet"],
46.       "ses:source-ip": ["192.0.2.0"],
47.       "ses:from-domain": ["example.com"],
48.       "ses:caller-identity": ["ses_user"],
49.       "myCustomTag1": ["myCustomValue1"],
50.       "myCustomTag2": ["myCustomValue2"]
51.     }
52.   },
53.   "subscription": {
54.     "contactList": "ContactListName",
55.     "timestamp": "2022-01-12T01:00:17.910Z",
56.     "source": "UnsubscribeHeader",
57.     "newTopicPreferences": {
58.       "unsubscribeAll": true,
59.       "topicSubscriptionStatus": [
60.         {
61.           "topicName": "ExampleTopicName",
62.           "subscriptionStatus": "OptOut"
63.         }
64.       ]
65.     },
66.     "oldTopicPreferences": {
67.       "unsubscribeAll": false,
68.       "topicSubscriptionStatus": [
69.         {
70.           "topicName": "ExampleTopicName",
71.           "subscriptionStatus": "OptOut"
72.         }
73.       ]
74.     }
75.   }
76. }
```

# 解释来自 Amazon SNS 的 Amazon SES 事件数据
<a name="event-publishing-retrieving-sns"></a>

Amazon SES 将电子邮件发送事件作为 JSON 记录发布到 Amazon Simple Notification Service（Amazon SNS）。然后，Amazon SNS 将通知发送到订阅了与事件目标关联的 Amazon SNS 主题的终端节点。有关设置 Amazon SNS 主题和订阅的信息，请参阅 *Amazon Simple Notification Service 开发人员指南*中的[入门](https://docs.aws.amazon.com/sns/latest/dg/GettingStarted.html)。

有关记录内容 (例如示例记录) 的说明，请参阅以下部分。
+ [事件记录内容](event-publishing-retrieving-sns-contents.md)
+ [事件记录示例](event-publishing-retrieving-sns-examples.md)

# Amazon SES 发布到 Amazon SNS 的事件数据的内容
<a name="event-publishing-retrieving-sns-contents"></a>

Amazon SES 以 JSON 格式将电子邮件发送事件记录发布到 Amazon Simple Notification Service。

您可以在 [Amazon SES 发布到 Amazon SNS 的事件数据示例](event-publishing-retrieving-sns-examples.md) 中找到所有这些通知类型的示例记录。

**Topics**
+ [顶级 JSON 对象](#event-publishing-retrieving-sns-contents-top-level-json-object)
+ [邮件对象](#event-publishing-retrieving-sns-contents-mail-object)
+ [退信对象](#event-publishing-retrieving-sns-contents-bounce-object)
+ [投诉对象](#event-publishing-retrieving-sns-contents-complaint-object)
+ [送达对象](#event-publishing-retrieving-sns-contents-delivery-object)
+ [发送对象](#event-publishing-retrieving-sns-contents-send-object)
+ [拒绝对象](#event-publishing-retrieving-sns-contents-reject-object)
+ [打开对象](#event-publishing-retrieving-sns-contents-open-object)
+ [单击对象](#event-publishing-retrieving-sns-contents-click-object)
+ [呈现失败对象](#event-publishing-retrieving-sns-contents-failure-object)
+ [DeliveryDelay 对象](#event-publishing-retrieving-sns-contents-delivery-delay-object)
+ [订阅对象](#event-publishing-retrieving-sns-contents-subscription-object)

## 顶级 JSON 对象
<a name="event-publishing-retrieving-sns-contents-top-level-json-object"></a>

电子邮件发送事件记录中的顶级 JSON 对象包含以下字段。事件类型决定了存在哪些其他对象。


| 字段名称 | 说明 | 
| --- | --- | 
|  `eventType`  |  一个描述事件类型的文本字符串。可能的值：`Bounce`、`Complaint`、`Delivery`、`Send`、`Reject`、`Open`、`Click`、`Rendering Failure`、`DeliveryDelay` 或 `Subscription`。 如果尚未[设置事件发布](monitor-sending-using-event-publishing-setup.md)，则此字段将命名为 `notificationType`。  | 
|  `mail`  |  JSON 对象，包含有关生成事件的电子邮件的信息。  | 
|  `bounce`  |  仅当 `eventType` 为 `Bounce` 时，此字段才存在。它包含有关退信的信息。  | 
|  `complaint`  |  仅当 `eventType` 为 `Complaint` 时，此字段才存在。它包含有关投诉的信息。  | 
|  `delivery`  |  仅当 `eventType` 为 `Delivery` 时，此字段才存在。它包含有关送达的信息。  | 
|  `send`  |  仅当 `eventType` 为 `Send` 时，此字段才存在。  | 
|  `reject`  |  仅当 `eventType` 为 `Reject` 时，此字段才存在。它包含有关拒绝的信息。  | 
|  `open`  |  仅当 `eventType` 为 `Open` 时，此字段才存在。它包含有关打开事件的信息。  | 
|  `click`  |  仅当 `eventType` 为 `Click` 时，此字段才存在。它包含有关点击事件的信息。  | 
| `failure` | 仅当 `eventType` 为 `Rendering Failure` 时，此字段才存在。它包含有关呈现失败事件的信息。 | 
|  `deliveryDelay`  |  仅当 `eventType` 为 `DeliveryDelay` 时，此字段才存在。它包含有关延迟送达电子邮件的信息。  | 
|  `subscription`  |  仅当 `eventType` 为 `Subscription` 时，此字段才存在。它包含有关订阅首选项的信息。  | 

## 邮件对象
<a name="event-publishing-retrieving-sns-contents-mail-object"></a>

每个电子邮件发送事件记录都包含有关 `mail` 对象中的原始电子邮件的信息。包含有关 `mail` 对象的信息的 JSON 对象具有以下字段。


| 字段名称 | 说明 | 
| --- | --- | 
|  `timestamp`  |  发送消息的日期和时间， ISO8601 格式为 (*YYYY-MM--: mm: ss.sz DDThh*)。  | 
|  `messageId`  |  Amazon SES 分配给电子邮件的唯一 ID。Amazon SES 在您发送邮件时已向您返回此值。  此邮件 ID 已由 Amazon SES 分配。您可以在 `mail` 对象的 `headers` 和 `commonHeaders` 字段中找到原始电子邮件的邮件 ID。   | 
|  `source`  |  发送邮件的电子邮件地址（信封 MAIL FROM 地址）。  | 
|  `sourceArn`  |  已用于发送电子邮件的身份的 Amazon Resource Name（ARN）。在发送授权的情况下，`sourceArn` 是身份拥有者授权委托发件人用于发送电子邮件的身份的 ARN。有关发送授权的更多信息，请参阅[电子邮件身份验证方法使用发送授权](sending-authorization.md)。  | 
|  `sendingAccountId`  |  用于发送电子邮件的账户的账户 ID。 AWS 在发送授权的情况下，`sendingAccountId` 是委托发件人的账户 ID。  | 
|  `destination`  |  作为原始邮件的收件人的电子邮件地址的列表。  | 
|  `headersTruncated`  |  一个字符串，指定标头是否会在通知中被截断，如果标头大于 10 KB，则会发生截断。可能的值为 `true` 和 `false`。  | 
|  `headers`  |  电子邮件的原始标头的列表。列表中的每个标头均有一个 `name` 字段和一个 `value` 字段。  `headers` 字段内的任何邮件 ID 均来自您传递至 Amazon SES 的原始邮件。Amazon SES 随后分配给电子邮件的邮件 ID 位于 `messageId` 对象的 `mail` 字段中。   | 
|  `commonHeaders`  |  电子邮件的原始常用标头的映射。  `commonHeaders` 字段中的任何邮件 ID 是 Amazon SES 随后在 `mail` 对象的 `messageId` 字段中分配给邮件的邮件 ID。   | 
|  `tags`  |  与电子邮件关联的标签的列表。  | 

## 退信对象
<a name="event-publishing-retrieving-sns-contents-bounce-object"></a>

包含有关 `Bounce` 事件的信息的 JSON 对象具有以下字段。


| 字段名称 | 说明 | 
| --- | --- | 
|  `bounceType`  |  退信的类型，由 Amazon SES 确定。  | 
|  `bounceSubType`  |  退信的子类型，由 Amazon SES 确定。  | 
|  `bouncedRecipients`  |  包含已退回的原始邮件收件人相关信息的列表。  | 
|  `timestamp`  |  互联网服务提供商发送退回通知的日期和时间， ISO8601 格式为 (*YYYY-MM--: mm: ss.sz DDThh*)。  | 
|  `feedbackId`  |  退信的唯一 ID。  | 
|  `reportingMTA`  |  DSN 中的 `Reporting-MTA` 字段的值。这是尝试执行 DSN 所述的传输、中继或网关操作的 Message Transfer Authority（MTA）的值。  此字段仅在传输状态通知（DSN）附加到退信时显示。   | 

### 退信的收件人
<a name="event-publishing-retrieving-sns-contents-bounced-recipients"></a>

退信事件可能与一个收件人或多个收件人有关。`bouncedRecipients` 字段包含一系列对象（其电子邮件地址导致退信的每个收件人各有一个对象）并包含以下字段。


| 字段名称 | 说明 | 
| --- | --- | 
|  `emailAddress`  |  收件人的电子邮件地址。如果 DSN 可用，这将是 DSN 中的 `Final-Recipient` 字段的值。  | 

（可选）如果 DSN 已附加到退信，则以下字段也可能存在。


| 字段名称 | 说明 | 
| --- | --- | 
|  `action`  |  DSN 中的 `Action` 字段的值。这表示报告 MTA 因尝试将邮件传输至此收件人而需执行的操作。  | 
|  `status`  |  DSN 中的 `Status` 字段的值。这是每个收件人与传输无关的状态代码，用于指示邮件的传输状态。  | 
|  `diagnosticCode`  |  报告 MTA 发放的状态代码。这是 DSN 中的 `Diagnostic-Code` 字段的值。此字段可能不在 DSN 中（因此也不在 JSON 中）。  | 

### 退信类型
<a name="event-publishing-retrieving-sns-contents-bounce-types"></a>

每个退信事件都属于下表中所示的类型之一。

事件发布系统仅发布不再由 Amazon SES 重试的硬退信和软退信。收到标有 `Permanent` 的退信时，应从邮件列表中删除对应的电子邮件地址；您将来无法向这些地址发送邮件。当某封邮件被软退回若干次并且 Amazon SES 已停止尝试再次传送它之后，系统将向您发送 `Transient` 退信。您将来或许能够成功重新发送到最初导致了 `Transient` 退信的地址。


| bounceType | bounceSubType | 说明 | 
| --- | --- | --- | 
|  `Undetermined`  |  `Undetermined`  |  Amazon SES 无法确定特定的退信原因。  | 
|  `Permanent`  |  `General`  |  Amazon SES 收到了一封常规硬退信。如果您收到此类退信，您应从邮件列表中删除收件人的电子邮件地址。  | 
|  `Permanent`  |  `NoEmail`  |  Amazon SES 收到永久硬退信，因为目标电子邮件地址不存在。如果您收到此类退信，您应从邮件列表中删除收件人的电子邮件地址。  | 
|  `Permanent`  |  `Suppressed`  |  Amazon SES 已禁止发送邮件到此地址，因为该地址最近出现过做作为无效地址被退回的历史记录。要覆盖全局黑名单，请参阅 [使用 Amazon SES 账户级黑名单](sending-email-suppression-list.md)。  | 
| Permanent | OnAccountSuppressionList | Amazon SES 已禁止发送到此地址，因为该地址已被加入[账户级黑名单](sending-email-suppression-list.md)。这不计入您的跳出率指标。 | 
|  `Transient`  |  `General`  |  Amazon SES 收到常规退信。将来，您也许能够向该收件人成功发送电子邮件。  | 
|  `Transient`  |  `MailboxFull`  |  Amazon SES 收到邮箱完全退信。将来，您也许能够向该收件人成功发送电子邮件。  | 
|  `Transient`  |  `MessageTooLarge`  |  Amazon SES 收到消息太大退信。如果您减小邮件的大小，则也许能够向该收件人成功发送电子邮件。  | 
|  `Transient`  |  `CustomTimeoutExceeded`  |  Amazon SES 无法在电子邮件发件人指定的时间内成功传送电子邮件。*（退回消息将指定在定义的 TTL 内任何可能的传送尝试失败的原因。）*   | 
|  `Transient`  |  `ContentRejected`  |  Amazon SES 收到内容拒绝退信。如果您更改邮件的内容，则也许能够向该收件人成功发送电子邮件。  | 
|  `Transient`  |  `AttachmentRejected`  |  Amazon SES 收到附件拒绝退信。如果您删除或更改附件，则也许能够向该收件人成功发送电子邮件。  | 

## 投诉对象
<a name="event-publishing-retrieving-sns-contents-complaint-object"></a>

包含有关 `Complaint` 事件的信息的 JSON 对象具有以下字段。


| 字段名称 | 说明 | 
| --- | --- | 
|  `complainedRecipients`  |  包含可能已提交投诉的收件人的相关信息列表。  | 
|  `timestamp`  |  互联网服务提供商发送投诉通知的日期和时间， ISO8601 格式为 (*YYYY-MM--: mm: ss.sz DDThh*)。  | 
|  `feedbackId`  |  投诉的唯一 ID。  | 
|  `complaintSubType`  |  投诉的子类型，由 Amazon SES 确定。  | 

此外，如果反馈报告已附加到投诉，则以下字段也可能存在。


| 字段名称 | 说明 | 
| --- | --- | 
|  `userAgent`  |  反馈报告中的 `User-Agent` 字段的值。此值表示生成了报告的系统的名称和版本。  | 
|  `complaintFeedbackType`  |  从 ISP 收到的反馈报告中的 `Feedback-Type` 字段的值。此值包含反馈的类型。  | 
|  `arrivalDate`  |  反馈报告中`Arrival-Date`或`Received-Date`字段的值， ISO8601 格式为 (*YYYY-MM--*: mm: ss.sz)。DDThh此字段可能不在报告中（因此也不在 JSON 中）。  | 

### 已投诉的收件人
<a name="event-publishing-retrieving-sns-contents-complained-recipients"></a>

`complainedRecipients` 字段包含可能已提交投诉的收件人的列表。

**重要**  
大多数 ISPs 会删除提交投诉的收件人的电子邮件地址。出于此原因，`complainedRecipients` 字段包含域中已向其发送电子邮件而该地址发布了投诉通知的所有人的列表。

此列表中的 JSON 对象包含以下字段。


| 字段名称 | 说明 | 
| --- | --- | 
|  `emailAddress`  |  收件人的电子邮件地址。  | 

### 投诉类型
<a name="event-publishing-retrieving-sns-contents-complaint-types"></a>

根据`complaintFeedbackType`互联网编号分配机构网站[，您可在由报告 ISP 分配的 ](https://www.iana.org/assignments/marf-parameters/marf-parameters.xml#marf-parameters-2) 字段中看到以下投诉类型：


| 字段名称 | 说明 | 
| --- | --- | 
|  `abuse`  |  指示未经请求的电子邮件或某种其他类型的电子邮件滥用。  | 
|  `auth-failure`  |  电子邮件身份验证失败报告。  | 
|  `fraud`  |  指示某种欺诈或网络钓鱼活动。  | 
|  `not-spam`  |  指示提供报告的实体不会将邮件视为垃圾邮件。这可用于更正被错误地标记或分类为垃圾邮件的邮件。  | 
|  `other`  |  指示不适合其他已注册类型的任何其他反馈。  | 
|  `virus`  |  报告在原始邮件中发现病毒。  | 

### 投诉子类型
<a name="event-publishing-retrieving-sns-contents-complaint-subtypes"></a>

`complaintSubType` 字段的值可以为 null 或 `OnAccountSuppressionList`。如果该值为 `OnAccountSuppressionList`，则表示 Amazon SES 已接受邮件，但未尝试发送邮件，因为该地址已被加入[账户级黑名单](sending-email-suppression-list.md)。

## 送达对象
<a name="event-publishing-retrieving-sns-contents-delivery-object"></a>

包含有关 `Delivery` 事件的信息的 JSON 对象具有以下字段。


| 字段名称 | 说明 | 
| --- | --- | 
|  `timestamp`  |  Amazon SES 将电子邮件发送到收件人的邮件服务器的日期和时间， ISO8601 格式为 (*YYYY-MM--*: mm: ss.sz)。DDThh  | 
|  `processingTimeMillis`  |  从 Amazon SES 接受来自发件人的请求到 Amazon SES 将邮件传递到收件人的邮件服务器的时间（以毫秒为单位）。  | 
|  `recipients`  |  传送事件应用于的预定收件人的列表。  | 
|  `smtpResponse`  |  从 Amazon SES 接受电子邮件的远程 ISP 的 SMTP 响应消息。此消息因电子邮件、接收邮件服务器以及接收 ISP 而异。  | 
|  `reportingMTA`  |  发送邮件的 Amazon SES 邮件服务器的主机名。  | 
|  `remoteMtaIp`  |  Amazon SES 将电子邮件送达的 MTA 的 IP 地址。  | 

## 发送对象
<a name="event-publishing-retrieving-sns-contents-send-object"></a>

包含有关 `send` 事件的信息的 JSON 对象始终为空。

## 拒绝对象
<a name="event-publishing-retrieving-sns-contents-reject-object"></a>

包含有关 `Reject` 事件的信息的 JSON 对象具有以下字段。


| 字段名称 | 说明 | 
| --- | --- | 
|  `reason`  |  电子邮件被拒绝的原因。唯一可能的值为 `Bad content`，这意味着 Amazon SES 检测到该电子邮件含有病毒。当某个邮件被拒绝时，Amazon SES 会停止处理该邮件，并且不会尝试将邮件发送到收件人的邮件服务器。  | 

## 打开对象
<a name="event-publishing-retrieving-sns-contents-open-object"></a>

包含有关 `Open` 事件的信息的 JSON 对象具有以下字段。


| 字段名称 | 说明 | 
| --- | --- | 
|  `ipAddress`  |  收件人的 IP 地址。  | 
|  `timestamp`  |  公开事件发生的日期和时间， ISO8601 格式为 (*YYYY-MM--*: mm: ss.sz)。DDThh  | 
|  `userAgent`  |  收件人用于打开电子邮件中的设备或电子邮件客户端的用户代理。  | 

## 单击对象
<a name="event-publishing-retrieving-sns-contents-click-object"></a>

包含有关 `Click` 事件的信息的 JSON 对象具有以下字段。


| 字段名称 | 说明 | 
| --- | --- | 
|  `ipAddress`  |  收件人的 IP 地址。  | 
|  `timestamp`  |  点击事件发生的日期和时间， ISO8601 格式为 (*YYYY-MM--*: mm: ss.sz)。DDThh  | 
|  `userAgent`  |  收件人单击电子邮件中链接时使用的客户端的用户代理。  | 
|  `link`  |  收件人点击的链接的 URL。  | 
|  `linkTags`  |  使用 `ses:tags` 属性添加到链接的标签的列表。有关向电子邮件中的链接添加标签的更多信息，请参阅 [Amazon SES 电子邮件发送指标 FAQs](faqs-metrics.md)中的[问题 5：我能否用唯一标识符来标记链接？](faqs-metrics.md#sending-metric-faqs-clicks-q5)。  | 

## 呈现失败对象
<a name="event-publishing-retrieving-sns-contents-failure-object"></a>

包含有关 `Rendering Failure` 事件的信息的 JSON 对象具有以下字段。


| 字段名称 | 说明 | 
| --- | --- | 
|  `templateName`  |  用于发送电子邮件的模板的名称。  | 
|  `errorMessage`  |  提供有关呈现失败详细信息的消息。  | 

## DeliveryDelay 对象
<a name="event-publishing-retrieving-sns-contents-delivery-delay-object"></a>

包含有关 `DeliveryDelay` 事件的信息的 JSON 对象具有以下字段。


| 字段名称 | 说明 | 
| --- | --- | 
|  `delayType`  |  延迟的类型。可能的值有： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/ses/latest/dg/event-publishing-retrieving-sns-contents.html)  | 
|  `delayedRecipients`  |  包含有关电子邮件收件人的信息的对象。  | 
|  `expirationTime`  |  Amazon SES 将停止尝试传输邮件的日期和时间。此值以 ISO 8601 格式显示。  | 
|  `reportingMTA`  |  报告延迟的邮件传输代理（MTA）的 IP 地址。  | 
|  `timestamp`  |  发生延迟的日期和时间，以 ISO 8601 格式显示。  | 

### 延迟的收件人
<a name="event-publishing-retrieving-sns-contents-delivery-delay-object-recipients"></a>

`delayedRecipients` 对象包含以下值。


| 字段名称 | 说明 | 
| --- | --- | 
|  `emailAddress`  |  导致邮件送达延迟的电子邮件地址。  | 
|  `status`  |  与送达延迟关联的 SMTP 状态代码。  | 
|  `diagnosticCode`  |  接收邮件传输代理（MTA）提供的诊断代码。  | 

## 订阅对象
<a name="event-publishing-retrieving-sns-contents-subscription-object"></a>

包含有关 `Subscription` 事件的信息的 JSON 对象具有以下字段。


| 字段名称 | 说明 | 
| --- | --- | 
|  `contactList`  |  联系人所在的列表的名称。  | 
|  `timestamp`  |  互联网服务提供商发送订阅通知的日期和时间， ISO8601 格式为 *(YYYY-MM--: mm: ss.sz DDThh*)。  | 
|  `source`  |  发送邮件的电子邮件地址（信封 MAIL FROM 地址）。  | 
|  `newTopicPreferences`  |  一个 JSON 数据结构（映射），它指定联系人列表中所有主题的订阅状态，用于指示更改后的状态（联系人已订阅或已取消订阅）。  | 
|  `oldTopicPreferences`  |  一个 JSON 数据结构（映射），它指定联系人列表中所有主题的订阅状态，用于指示更改前的状态（联系人已订阅或已取消订阅）。  | 

### 新/旧主题首选项
<a name="event-publishing-retrieving-sns-contents-subscription-object-topic-preferences"></a>

`newTopicPreferences` 和 `oldTopicPreferences` 对象包含以下值。


| 字段名称 | 说明 | 
| --- | --- | 
|  `unsubscribeAll`  |  指定联系人是否已取消订阅联系人列表中的所有主题。  | 
|  `topicSubscriptionStatus`  |  在 `topicName` 字段中指定主题的订阅状态，该字段指示该主题当前是否已订阅以接收来自 SES 的指定事件类型的通知。字段中可能的值为 **OptIn**（已订阅）或 **OptOut**（取消订阅）。`subscriptionStatus`  | 
|  `topicDefaultSubscriptionStatus`  |  在 `topicName` 字段中指定主题的默认订阅状态，以确定默认情况下是订阅还是取消订阅添加到事件目标的新主题。字段中可能的值为 **OptIn**（默认情况下已订阅）或 **OptOut**（默认取消订阅）。`subscriptionStatus`  | 

# Amazon SES 发布到 Amazon SNS 的事件数据示例
<a name="event-publishing-retrieving-sns-examples"></a>

本节提供了一些示例，介绍 Amazon SES 发布到 Amazon SNS 的电子邮件发送事件记录类型。

**Topics**
+ [退信记录](#event-publishing-retrieving-sns-bounce)
+ [投诉记录](#event-publishing-retrieving-sns-complaint)
+ [送达记录](#event-publishing-retrieving-sns-delivery)
+ [发送记录](#event-publishing-retrieving-sns-send)
+ [拒绝记录](#event-publishing-retrieving-sns-reject)
+ [打开记录](#event-publishing-retrieving-sns-open)
+ [单击记录](#event-publishing-retrieving-sns-click)
+ [呈现失败记录](#event-publishing-retrieving-sns-failure)
+ [DeliveryDelay 记录](#event-publishing-retrieving-sns-delayed-delivery)
+ [订阅记录](#event-publishing-retrieving-sns-subscription)

**注意**  
在以下使用 `tag` 字段的示例中，它使用通过配置集发布事件，而 SES 支持发布所有事件类型的标签。如果直接使用关于身份的反馈通知，则 SES 不会发布标签。阅读有关在[创建配置集](creating-configuration-sets.md)或[修改配置集](managing-configuration-sets.md#console-detail-configuration-sets)时添加标签的内容。

## 退信记录
<a name="event-publishing-retrieving-sns-bounce"></a>

下面是 Amazon SES 发布到 Amazon SNS 的 `Bounce` 事件记录的一个示例。

```
 1. {
 2.   "eventType":"Bounce",
 3.   "bounce":{
 4.     "bounceType":"Permanent",
 5.     "bounceSubType":"General",
 6.     "bouncedRecipients":[
 7.       {
 8.         "emailAddress":"recipient@example.com",
 9.         "action":"failed",
10.         "status":"5.1.1",
11.         "diagnosticCode":"smtp; 550 5.1.1 user unknown"
12.       }
13.     ],
14.     "timestamp":"2017-08-05T00:41:02.669Z",
15.     "feedbackId":"01000157c44f053b-61b59c11-9236-11e6-8f96-7be8aexample-000000",
16.     "reportingMTA":"dsn; mta.example.com"
17.   },
18.   "mail":{
19.     "timestamp":"2017-08-05T00:40:02.012Z",
20.     "source":"Sender Name <sender@example.com>",
21.     "sourceArn":"arn:aws:ses:us-east-1:123456789012:identity/sender@example.com",
22.     "sendingAccountId":"123456789012",
23.     "messageId":"EXAMPLE7c191be45-e9aedb9a-02f9-4d12-a87d-dd0099a07f8a-000000",
24.     "destination":[
25.       "recipient@example.com"
26.     ],
27.     "headersTruncated":false,
28.     "headers":[
29.       {
30.         "name":"From",
31.         "value":"Sender Name <sender@example.com>"
32.       },
33.       {
34.         "name":"To",
35.         "value":"recipient@example.com"
36.       },
37.       {
38.         "name":"Subject",
39.         "value":"Message sent from Amazon SES"
40.       },
41.       {
42.         "name":"MIME-Version",
43.         "value":"1.0"
44.       },
45.       {
46.         "name":"Content-Type",
47.         "value":"multipart/alternative; boundary=\"----=_Part_7307378_1629847660.1516840721503\""
48.       }
49.     ],
50.     "commonHeaders":{
51.       "from":[
52.         "Sender Name <sender@example.com>"
53.       ],
54.       "to":[
55.         "recipient@example.com"
56.       ],
57.       "messageId":"EXAMPLE7c191be45-e9aedb9a-02f9-4d12-a87d-dd0099a07f8a-000000",
58.       "subject":"Message sent from Amazon SES"
59.     },
60.     "tags":{
61.       "ses:configuration-set":[
62.         "ConfigSet"
63.       ],
64.       "ses:source-ip":[
65.         "192.0.2.0"
66.       ],
67.       "ses:from-domain":[
68.         "example.com"
69.       ],
70.       "ses:caller-identity":[
71.         "ses_user"
72.       ]
73.     }
74.   }
75. }
```

## 投诉记录
<a name="event-publishing-retrieving-sns-complaint"></a>

下面是 Amazon SES 发布到 Amazon SNS 的 `Complaint` 事件记录的一个示例。

```
 1. {
 2.   "eventType":"Complaint",
 3.   "complaint": {
 4.     "complainedRecipients":[
 5.       {
 6.         "emailAddress":"recipient@example.com"
 7.       }
 8.     ],
 9.     "timestamp":"2017-08-05T00:41:02.669Z",
10.     "feedbackId":"01000157c44f053b-61b59c11-9236-11e6-8f96-7be8aexample-000000",
11.     "userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36",
12.     "complaintFeedbackType":"abuse",
13.     "arrivalDate":"2017-08-05T00:41:02.669Z"
14.   },
15.   "mail":{
16.     "timestamp":"2017-08-05T00:40:01.123Z",
17.     "source":"Sender Name <sender@example.com>",
18.     "sourceArn":"arn:aws:ses:us-east-1:123456789012:identity/sender@example.com",
19.     "sendingAccountId":"123456789012",
20.     "messageId":"EXAMPLE7c191be45-e9aedb9a-02f9-4d12-a87d-dd0099a07f8a-000000",
21.     "destination":[
22.       "recipient@example.com"
23.     ],
24.     "headersTruncated":false,
25.     "headers":[
26.       {
27.         "name":"From",
28.         "value":"Sender Name <sender@example.com>"
29.       },
30.       {
31.         "name":"To",
32.         "value":"recipient@example.com"
33.       },
34.       {
35.         "name":"Subject",
36.         "value":"Message sent from Amazon SES"
37.       },
38.       {
39.         "name":"MIME-Version","value":"1.0"
40.       },
41.       {
42.         "name":"Content-Type",
43.         "value":"multipart/alternative; boundary=\"----=_Part_7298998_679725522.1516840859643\""
44.       }
45.     ],
46.     "commonHeaders":{
47.       "from":[
48.         "Sender Name <sender@example.com>"
49.       ],
50.       "to":[
51.         "recipient@example.com"
52.       ],
53.       "messageId":"EXAMPLE7c191be45-e9aedb9a-02f9-4d12-a87d-dd0099a07f8a-000000",
54.       "subject":"Message sent from Amazon SES"
55.     },
56.     "tags":{
57.       "ses:configuration-set":[
58.         "ConfigSet"
59.       ],
60.       "ses:source-ip":[
61.         "192.0.2.0"
62.       ],
63.       "ses:from-domain":[
64.         "example.com"
65.       ],
66.       "ses:caller-identity":[
67.         "ses_user"
68.       ]
69.     }
70.   }
71. }
```

## 送达记录
<a name="event-publishing-retrieving-sns-delivery"></a>

下面是 Amazon SES 发布到 Amazon SNS 的 `Delivery` 事件记录的一个示例。

```
 1. {
 2.   "eventType": "Delivery",
 3.   "mail": {
 4.     "timestamp": "2016-10-19T23:20:52.240Z",
 5.     "source": "sender@example.com",
 6.     "sourceArn": "arn:aws:ses:us-east-1:123456789012:identity/sender@example.com",
 7.     "sendingAccountId": "123456789012",
 8.     "messageId": "EXAMPLE7c191be45-e9aedb9a-02f9-4d12-a87d-dd0099a07f8a-000000",
 9.     "destination": [
10.       "recipient@example.com"
11.     ],
12.     "headersTruncated": false,
13.     "headers": [
14.       {
15.         "name": "From",
16.         "value": "sender@example.com"
17.       },
18.       {
19.         "name": "To",
20.         "value": "recipient@example.com"
21.       },
22.       {
23.         "name": "Subject",
24.         "value": "Message sent from Amazon SES"
25.       },
26.       {
27.         "name": "MIME-Version",
28.         "value": "1.0"
29.       },
30.       {
31.         "name": "Content-Type",
32.         "value": "text/html; charset=UTF-8"
33.       },
34.       {
35.         "name": "Content-Transfer-Encoding",
36.         "value": "7bit"
37.       }
38.     ],
39.     "commonHeaders": {
40.       "from": [
41.         "sender@example.com"
42.       ],
43.       "to": [
44.         "recipient@example.com"
45.       ],
46.       "messageId": "EXAMPLE7c191be45-e9aedb9a-02f9-4d12-a87d-dd0099a07f8a-000000",
47.       "subject": "Message sent from Amazon SES"
48.     },
49.     "tags": {
50.       "ses:configuration-set": [
51.         "ConfigSet"
52.       ],
53.       "ses:source-ip": [
54.         "192.0.2.0"
55.       ],
56.       "ses:from-domain": [
57.         "example.com"
58.       ],
59.       "ses:caller-identity": [
60.         "ses_user"
61.       ],
62.       "ses:outgoing-ip": [
63.         "192.0.2.0"
64.       ],
65.       "myCustomTag1": [
66.         "myCustomTagValue1"
67.       ],
68.       "myCustomTag2": [
69.         "myCustomTagValue2"
70.       ]      
71.     }
72.   },
73.   "delivery": {
74.     "timestamp": "2016-10-19T23:21:04.133Z",
75.     "processingTimeMillis": 11893,
76.     "recipients": [
77.       "recipient@example.com"
78.     ],
79.     "smtpResponse": "250 2.6.0 Message received",
80.     "remoteMtaIp": "123.456.789.012",
81.     "reportingMTA": "mta.example.com"
82.   }
83. }
```

## 发送记录
<a name="event-publishing-retrieving-sns-send"></a>

下面是 Amazon SES 发布到 Amazon SNS 的 `Send` 事件记录的一个示例。有些字段并不总是存在。例如，使用模板电子邮件，主题稍后会呈现并包含在后续活动中。

```
 1. {
 2.   "eventType": "Send",
 3.   "mail": {
 4.     "timestamp": "2016-10-14T05:02:16.645Z",
 5.     "source": "sender@example.com",
 6.     "sourceArn": "arn:aws:ses:us-east-1:123456789012:identity/sender@example.com",
 7.     "sendingAccountId": "123456789012",
 8.     "messageId": "EXAMPLE7c191be45-e9aedb9a-02f9-4d12-a87d-dd0099a07f8a-000000",
 9.     "destination": [
10.       "recipient@example.com"
11.     ],
12.     "headersTruncated": false,
13.     "headers": [
14.       {
15.         "name": "From",
16.         "value": "sender@example.com"
17.       },
18.       {
19.         "name": "To",
20.         "value": "recipient@example.com"
21.       },
22.       {
23.         "name": "Subject",
24.         "value": "Message sent from Amazon SES"
25.       },
26.       {
27.         "name": "MIME-Version",
28.         "value": "1.0"
29.       },
30.       {
31.         "name": "Content-Type",
32.         "value": "multipart/mixed;  boundary=\"----=_Part_0_716996660.1476421336341\""
33.       },
34.       {
35.         "name": "X-SES-MESSAGE-TAGS",
36.         "value": "myCustomTag1=myCustomTagValue1, myCustomTag2=myCustomTagValue2"
37.       }
38.     ],
39.     "commonHeaders": {
40.       "from": [
41.         "sender@example.com"
42.       ],
43.       "to": [
44.         "recipient@example.com"
45.       ],
46.       "messageId": "EXAMPLE7c191be45-e9aedb9a-02f9-4d12-a87d-dd0099a07f8a-000000",
47.       "subject": "Message sent from Amazon SES"
48.     },
49.     "tags": {
50.       "ses:configuration-set": [
51.         "ConfigSet"
52.       ],
53.       "ses:source-ip": [
54.         "192.0.2.0"
55.       ],
56.       "ses:from-domain": [
57.         "example.com"
58.       ],      
59.       "ses:caller-identity": [
60.         "ses_user"
61.       ],
62.       "myCustomTag1": [
63.         "myCustomTagValue1"
64.       ],
65.       "myCustomTag2": [
66.         "myCustomTagValue2"
67.       ]      
68.     }
69.   },
70.   "send": {}
71. }
```

## 拒绝记录
<a name="event-publishing-retrieving-sns-reject"></a>

下面是 Amazon SES 发布到 Amazon SNS 的 `Reject` 事件记录的一个示例。

```
 1. {
 2.   "eventType": "Reject",
 3.   "mail": {
 4.     "timestamp": "2016-10-14T17:38:15.211Z",
 5.     "source": "sender@example.com",
 6.     "sourceArn": "arn:aws:ses:us-east-1:123456789012:identity/sender@example.com",
 7.     "sendingAccountId": "123456789012",
 8.     "messageId": "EXAMPLE7c191be45-e9aedb9a-02f9-4d12-a87d-dd0099a07f8a-000000",
 9.     "destination": [
10.       "sender@example.com"
11.     ],
12.     "headersTruncated": false,
13.     "headers": [
14.       {
15.         "name": "From",
16.         "value": "sender@example.com"
17.       },
18.       {
19.         "name": "To",
20.         "value": "recipient@example.com"
21.       },      
22.       {
23.         "name": "Subject",
24.         "value": "Message sent from Amazon SES"
25.       },
26.       {
27.         "name": "MIME-Version",
28.         "value": "1.0"
29.       },      
30.       {
31.         "name": "Content-Type",
32.         "value": "multipart/mixed; boundary=\"qMm9M+Fa2AknHoGS\""
33.       },
34.       {
35.         "name": "X-SES-MESSAGE-TAGS",
36.         "value": "myCustomTag1=myCustomTagValue1, myCustomTag2=myCustomTagValue2"
37.       }  
38.     ],
39.     "commonHeaders": {
40.       "from": [
41.         "sender@example.com"
42.       ],
43.       "to": [
44.         "recipient@example.com"
45.       ],
46.       "messageId": "EXAMPLE7c191be45-e9aedb9a-02f9-4d12-a87d-dd0099a07f8a-000000",
47.       "subject": "Message sent from Amazon SES"
48.     },
49.     "tags": {
50.       "ses:configuration-set": [
51.         "ConfigSet"
52.       ],
53.       "ses:source-ip": [
54.         "192.0.2.0"
55.       ],
56.       "ses:from-domain": [
57.         "example.com"
58.       ],    
59.       "ses:caller-identity": [
60.         "ses_user"
61.       ],
62.       "myCustomTag1": [
63.         "myCustomTagValue1"
64.       ],
65.       "myCustomTag2": [
66.         "myCustomTagValue2"
67.       ]      
68.     }
69.   },
70.   "reject": {
71.     "reason": "Bad content"
72.   }
73. }
```

## 打开记录
<a name="event-publishing-retrieving-sns-open"></a>

下面是 Amazon SES 发布到 Amazon SNS 的 `Open` 事件记录的一个示例。

```
 1. {
 2.   "eventType": "Open",
 3.   "mail": {
 4.     "commonHeaders": {
 5.       "from": [
 6.         "sender@example.com"
 7.       ],
 8.       "messageId": "EXAMPLE7c191be45-e9aedb9a-02f9-4d12-a87d-dd0099a07f8a-000000",
 9.       "subject": "Message sent from Amazon SES",
10.       "to": [
11.         "recipient@example.com"
12.       ]
13.     },
14.     "destination": [
15.       "recipient@example.com"
16.     ],
17.     "headers": [
18.       {
19.         "name": "X-SES-CONFIGURATION-SET",
20.         "value": "ConfigSet"
21.       },
22.       {
23.         "name":"X-SES-MESSAGE-TAGS",
24.         "value":"myCustomTag1=myCustomValue1, myCustomTag2=myCustomValue2"
25.       },
26.       {
27.         "name": "From",
28.         "value": "sender@example.com"
29.       },
30.       {
31.         "name": "To",
32.         "value": "recipient@example.com"
33.       },
34.       {
35.         "name": "Subject",
36.         "value": "Message sent from Amazon SES"
37.       },
38.       {
39.         "name": "MIME-Version",
40.         "value": "1.0"
41.       },
42.       {
43.         "name": "Content-Type",
44.         "value": "multipart/alternative; boundary=\"XBoundary\""
45.       }
46.     ],
47.     "headersTruncated": false,
48.     "messageId": "EXAMPLE7c191be45-e9aedb9a-02f9-4d12-a87d-dd0099a07f8a-000000",
49.     "sendingAccountId": "123456789012",
50.     "source": "sender@example.com",
51.     "tags": {
52.       "myCustomTag1":[
53.         "myCustomValue1"
54.       ],
55.       "myCustomTag2":[
56.         "myCustomValue2"
57.       ],
58.       "ses:caller-identity": [
59.         "IAM_user_or_role_name"
60.       ],
61.       "ses:configuration-set": [
62.         "ConfigSet"
63.       ],
64.       "ses:from-domain": [
65.         "example.com"
66.       ],
67.       "ses:source-ip": [
68.         "192.0.2.0"
69.       ]
70.     },
71.     "timestamp": "2017-08-09T21:59:49.927Z"
72.   },
73.   "open": {
74.     "ipAddress": "192.0.2.1",
75.     "timestamp": "2017-08-09T22:00:19.652Z",
76.     "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_3 like Mac OS X) AppleWebKit/603.3.8 (KHTML, like Gecko) Mobile/14G60"
77.   }
78. }
```

## 单击记录
<a name="event-publishing-retrieving-sns-click"></a>

下面是 Amazon SES 发布到 Amazon SNS 的 `Click` 事件记录的一个示例。

```
 1. {
 2.   "eventType": "Click",
 3.   "click": {
 4.     "ipAddress": "192.0.2.1",
 5.     "link": "http://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-email-smtp.html",
 6.     "linkTags": {
 7.       "samplekey0": [
 8.         "samplevalue0"
 9.       ],
10.       "samplekey1": [
11.         "samplevalue1"
12.       ]
13.     },
14.     "timestamp": "2017-08-09T23:51:25.570Z",
15.     "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36"
16.   },
17.   "mail": {
18.     "commonHeaders": {
19.       "from": [
20.         "sender@example.com"
21.       ],
22.       "messageId": "EXAMPLE7c191be45-e9aedb9a-02f9-4d12-a87d-dd0099a07f8a-000000",
23.       "subject": "Message sent from Amazon SES",
24.       "to": [
25.         "recipient@example.com"
26.       ]
27.     },
28.     "destination": [
29.       "recipient@example.com"
30.     ],
31.     "headers": [
32.       {
33.         "name": "X-SES-CONFIGURATION-SET",
34.         "value": "ConfigSet"
35.       },
36.       {
37.         "name":"X-SES-MESSAGE-TAGS",
38.         "value":"myCustomTag1=myCustomValue1, myCustomTag2=myCustomValue2"
39.       },
40.       {
41.         "name": "From",
42.         "value": "sender@example.com"
43.       },
44.       {
45.         "name": "To",
46.         "value": "recipient@example.com"
47.       },
48.       {
49.         "name": "Subject",
50.         "value": "Message sent from Amazon SES"
51.       },
52.       {
53.         "name": "MIME-Version",
54.         "value": "1.0"
55.       },
56.       {
57.         "name": "Content-Type",
58.         "value": "multipart/alternative; boundary=\"XBoundary\""
59.       },
60.       {
61.         "name": "Message-ID",
62.         "value": "EXAMPLE7c191be45-e9aedb9a-02f9-4d12-a87d-dd0099a07f8a-000000"
63.       }
64.     ],
65.     "headersTruncated": false,
66.     "messageId": "EXAMPLE7c191be45-e9aedb9a-02f9-4d12-a87d-dd0099a07f8a-000000",
67.     "sendingAccountId": "123456789012",
68.     "source": "sender@example.com",
69.     "tags": {
70.       "myCustomTag1":[
71.         "myCustomValue1"
72.       ],
73.       "myCustomTag2":[
74.         "myCustomValue2"
75.       ],
76.       "ses:caller-identity": [
77.         "ses_user"
78.       ],
79.       "ses:configuration-set": [
80.         "ConfigSet"
81.       ],
82.       "ses:from-domain": [
83.         "example.com"
84.       ],
85.       "ses:source-ip": [
86.         "192.0.2.0"
87.       ]
88.     },
89.     "timestamp": "2017-08-09T23:50:05.795Z"
90.   }
91. }
```

## 呈现失败记录
<a name="event-publishing-retrieving-sns-failure"></a>

下面是 Amazon SES 发布到 Amazon SNS 的 `Rendering Failure` 事件记录的一个示例。

```
 1. {
 2.   "eventType":"Rendering Failure",
 3.   "mail":{
 4.     "timestamp":"2018-01-22T18:43:06.197Z",
 5.     "source":"sender@example.com",
 6.     "sourceArn":"arn:aws:ses:us-east-1:123456789012:identity/sender@example.com",
 7.     "sendingAccountId":"123456789012",
 8.     "messageId":"EXAMPLE7c191be45-e9aedb9a-02f9-4d12-a87d-dd0099a07f8a-000000",
 9.     "destination":[
10.       "recipient@example.com"
11.     ],
12.     "headersTruncated":false,
13.     "tags":{
14.       "ses:configuration-set":[
15.         "ConfigSet"
16.       ]
17.     }
18.   },
19.   "failure":{
20.     "errorMessage":"Attribute 'attributeName' is not present in the rendering data.",
21.     "templateName":"MyTemplate"
22.   }
23. }
```

## DeliveryDelay 记录
<a name="event-publishing-retrieving-sns-delayed-delivery"></a>

下面是 Amazon SES 发布到 Amazon SNS 的 `DeliveryDelay` 事件记录的一个示例。

```
 1. {
 2.   "eventType": "DeliveryDelay",
 3.   "mail":{
 4.     "timestamp":"2020-06-16T00:15:40.641Z",
 5.     "source":"sender@example.com",
 6.     "sourceArn":"arn:aws:ses:us-east-1:123456789012:identity/sender@example.com",
 7.     "sendingAccountId":"123456789012",
 8.     "messageId":"EXAMPLE7c191be45-e9aedb9a-02f9-4d12-a87d-dd0099a07f8a-000000",
 9.     "destination":[
10.       "recipient@example.com"
11.     ],
12.     "headersTruncated":false,
13.     "tags":{
14.       "ses:configuration-set":[
15.         "ConfigSet"
16.       ]
17.     }
18.   },
19.   "deliveryDelay": {
20.     "timestamp": "2020-06-16T00:25:40.095Z",
21.     "delayType": "TransientCommunicationFailure",
22.     "expirationTime": "2020-06-16T00:25:40.914Z",
23.     "delayedRecipients": [{
24.       "emailAddress": "recipient@example.com",
25.       "status": "4.4.1",
26.       "diagnosticCode": "smtp; 421 4.4.1 Unable to connect to remote host"
27.     }]
28.   }
29. }
```

## 订阅记录
<a name="event-publishing-retrieving-sns-subscription"></a>

下面是 Amazon SES 发布到 Firehose 的 `Subscription` 事件记录的一个示例。

```
 1. {
 2.   "eventType": "Subscription",
 3.   "mail": {
 4.     "timestamp": "2022-01-12T01:00:14.340Z",
 5.     "source": "sender@example.com",
 6.     "sourceArn": "arn:aws:ses:us-east-1:123456789012:identity/sender@example.com",
 7.     "sendingAccountId": "123456789012",
 8.     "messageId": "EXAMPLEe4bccb684-777bc8de-afa7-4970-92b0-f515137b1497-000000",
 9.     "destination": ["recipient@example.com"],
10.     "headersTruncated": false,
11.     "headers": [
12.       {
13.         "name": "From",
14.         "value": "sender@example.com"
15.       },
16.       {
17.         "name": "To",
18.         "value": "recipient@example.com"
19.       },
20.       {
21.         "name": "Subject",
22.         "value": "Message sent from Amazon SES"
23.       },
24.       {
25.         "name": "MIME-Version",
26.         "value": "1.0"
27.       },
28.       {
29.         "name": "Content-Type",
30.         "value": "text/html; charset=UTF-8"
31.       },
32.       {
33.         "name": "Content-Transfer-Encoding",
34.         "value": "7bit"
35.       }
36.     ],
37.     "commonHeaders": {
38.       "from": ["sender@example.com"],
39.       "to": ["recipient@example.com"],
40.       "messageId": "EXAMPLEe4bccb684-777bc8de-afa7-4970-92b0-f515137b1497-000000",
41.       "subject": "Message sent from Amazon SES"
42.     },
43.     "tags": {
44.       "ses:operation": ["SendEmail"],
45.       "ses:configuration-set": ["ConfigSet"],
46.       "ses:source-ip": ["192.0.2.0"],
47.       "ses:from-domain": ["example.com"],
48.       "ses:caller-identity": ["ses_user"],
49.       "myCustomTag1": ["myCustomValue1"],
50.       "myCustomTag2": ["myCustomValue2"]
51.     }
52.   },
53.   "subscription": {
54.     "contactList": "ContactListName",
55.     "timestamp": "2022-01-12T01:00:17.910Z",
56.     "source": "UnsubscribeHeader",
57.     "newTopicPreferences": {
58.       "unsubscribeAll": true,
59.       "topicSubscriptionStatus": [
60.         {
61.           "topicName": "ExampleTopicName",
62.           "subscriptionStatus": "OptOut"
63.         }
64.       ]
65.     },
66.     "oldTopicPreferences": {
67.       "unsubscribeAll": false,
68.       "topicSubscriptionStatus": [
69.         {
70.           "topicName": "ExampleTopicName",
71.           "subscriptionStatus": "OptOut"
72.         }
73.       ]
74.     }
75.   }
76. }
```