

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

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

在您[設定事件發佈](monitor-sending-using-event-publishing-setup.md)並為傳送電子郵件指定組態設定後，您可以從您在設定與電子郵件相關聯的組態設定時所指定的事件目標擷取電子郵件傳送事件。

本節說明如何從 Amazon CloudWatch 和 Amazon Data Firehose 擷取您的電子郵件傳送事件，以及如何解譯 Amazon SNS 提供的事件資料。
+ [從 CloudWatch 擷取 Amazon SES 事件資料](event-publishing-retrieving-cloudwatch.md)
+ [從 Firehose 擷取 Amazon SES 事件資料](event-publishing-retrieving-firehose.md)
+ [解譯 Amazon SNS 提供的 Amazon SES 事件資料](event-publishing-retrieving-sns.md)

# 從 CloudWatch 擷取 Amazon SES 事件資料
<a name="event-publishing-retrieving-cloudwatch"></a>

Amazon SES 可以將電子郵件傳送事件的指標發佈到 Amazon CloudWatch。發佈事件資料至 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 自動提供的[自動標籤](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 仍會將其視為傳送，但會禁止遞送)。
+ **轉譯失敗** – 因範本轉譯問題而未傳送電子郵件。範本資料遺失或是範本參數與資料不相符時，可能會出現此事件類型。(只有使用 [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 成功將電子郵件交付給收件人的郵件伺服器。
+ **退信** – *硬退信*代表收件人的郵件伺服器永久拒絕電子郵件。（只有在 SES 不再嘗試傳送電子郵件時，才會包含*軟退信*。 一般而言，這些軟退信表示交付失敗，但在某些情況下，即使郵件成功到達收件人收件匣，也可以傳回軟退信。 這通常發生在收件人傳送out-of-office的自動回覆時。 在此 [AWS re：Post 文章](https://repost.aws/knowledge-center/ses-understand-soft-bounces)中進一步了解軟退信。)
+ **Complaint (投訴)** - 電子郵件已成功遞送至收件人的郵件伺服器，但收件人將其標示為垃圾郵件。
+ **交付延遲** – 因為發生暫時問題，所以無法將電子郵件遞送至收件人的郵件伺服器。例如，當收件人的收件匣已滿時，或接收電子郵件伺服器暫時發生問題時，可能會發生傳遞延遲。
+ **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 管理主控台 並開啟位於 https：//[https://console.aws.amazon.com/cloudwatch/](https://console.aws.amazon.com/cloudwatch/) 的 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 會將電子郵件傳送事件發佈至 Firehose 做為 JSON 記錄。接著 Firehose 會將記錄發佈到您在 Firehose 中設定交付串流時所選擇的 AWS 服務目的地。如需有關設定 Firehose 交付串流的資訊，請參閱[《Amazon Data Firehose 開發人員指南》中的建立 Firehose 交付串流](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 物件包含下列欄位。


| 欄位名稱 | Description | 
| --- | --- | 
|  `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 物件有下列欄位。


| 欄位名稱 | Description | 
| --- | --- | 
|  `timestamp`  |  傳送訊息的日期和時間，格式為 ISO8601 (*YYYY-MM-DDThh:mm:ss.sZ*)。  | 
|  `messageId`  |  Amazon SES 指派給訊息的專有 ID。您傳送訊息後，Amazon SES 會回傳此數值給您。  此訊息 ID 是由 Amazon SES 指派。您可以在原始電子郵件內 `headers` 物件的 `commonHeaders` 與 `mail` 欄位找到訊息 ID。   | 
|  `source`  |  傳送出該訊息的電子郵件地址 (信封的「寄件人」地址)。  | 
|  `sourceArn`  |  用以傳送電子郵件之身分的 Amazon Resource Name (ARN)。在傳送授權的情況下，`sourceArn` 為身分持有者授權給委託寄件者之身分的 ARN，用以傳送電子郵件。如需關於傳送授權的詳細資訊，請參閱 [電子郵件身分驗證方法使用傳送授權](sending-authorization.md)。  | 
|  `sendingAccountId`  |  用來傳送電子郵件之帳戶的帳戶 AWS ID。在傳送授權的情況下，`sendingAccountId` 為委託寄件者的帳戶 ID。  | 
|  `destination`  |  原始郵件收件人的電子郵件地址清單。  | 
|  `headersTruncated`  |  說明通知中的標題是否已截斷的字串，會在標題大於 10 KB 時顯示。可能值為 `true` 和 `false`。  | 
|  `headers`  |  電子郵件原始標題的清單。清單中的每項標題都有 `name` 欄位與 `value` 欄位。  `headers` 欄位中的任何訊息 ID 都來自於您傳遞給 Amazon SES 的原始訊息。Amazon SES 隨即指派給訊息的訊息 ID 位於 `mail` 物件的 `messageId` 欄位內。   | 
|  `commonHeaders`  |  電子郵件常用的原始標頭映射。  任何 `commonHeaders` 欄位內的訊息 ID 皆為 Amazon SES 隨即指派給訊息的訊息 ID，位於 `mail` 物件的 `messageId` 欄位內。   | 
|  `tags`  |  與電子郵件相關聯的標籤清單。  | 

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

其中包含關於 `Bounce` 事件的 JSON 物件將會有下列欄位。


| 欄位名稱 | Description | 
| --- | --- | 
|  `bounceType`  |  退信類型，由 Amazon SES 判定。  | 
|  `bounceSubType`  |  退信的副類型，由 Amazon SES 判定。  | 
|  `bouncedRecipients`  |  其中包含遭退信的原始郵件收件人之相關資訊的清單。  | 
|  `timestamp`  |  ISP 傳送退信通知時的日期和時間，其格式為 ISO8601 格式 (*YYYY-MM-DDThh:mm:ss.sZ*)。  | 
|  `feedbackId`  |  退信的唯一 ID。  | 
|  `reportingMTA`  |  來自 DSN 的 `Reporting-MTA` 欄位數值。這是嘗試執行傳遞、轉傳或閘道操作的 Message Transfer Authority (MTA) 值，如 DSN 中所述。  此欄位只有在傳遞狀態通知 (DSN) 與退信連接時才會顯示。   | 

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

退信事件可能與單一收件人或多個收件人相關。`bouncedRecipients` 欄位擁有物件清單 (每個收件人與退信事件相關的每個物件皆有一個清單)，且將一律包含下列欄位。


| 欄位名稱 | Description | 
| --- | --- | 
|  `emailAddress`  |  收件人的電子郵件地址。若有可用的 DSN，此為來自 DSN 的 `Final-Recipient` 欄位值。  | 

或者，如果 DSN 連接到退信，也可能會顯示下列欄位。


| 欄位名稱 | Description | 
| --- | --- | 
|  `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` 的退信時，您應該從電子清單中移除對應的電子郵件地址，您將來無法再傳送給他們。當訊息發生多次軟退信時，您會收到 `Transient` 退信，而 Amazon SES 會停止嘗試重新遞送該訊息。未來您也許可以成功重新傳送給一開始導致 `Transient` 退信的地址。


| bounceType | bounceSubType | Description | 
| --- | --- | --- | 
|  `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 物件有下列欄位。


| 欄位名稱 | Description | 
| --- | --- | 
|  `complainedRecipients`  |  清單中包含可能曾提出投訴的收件人相關資訊。  | 
|  `timestamp`  |  ISP 傳送抱怨通知時的日期和時間，其格式為 ISO8601 格式 (*YYYY-MM-DDThh: mm: ss.sZ*)。  | 
|  `feedbackId`  |  投訴的唯一 ID。  | 
|  `complaintSubType`  |  投訴的子類型，由 Amazon SES 判定。  | 

此外，如果意見回饋報告連接到該投訴，可能顯示下列欄位。


| 欄位名稱 | Description | 
| --- | --- | 
|  `userAgent`  |  來自意見回饋報告的 `User-Agent` 欄位數值。這表示產生報告的系統名稱和版本。  | 
|  `complaintFeedbackType`  |  自 ISP 傳送的意見回饋報告中的 `Feedback-Type` 欄位數值。這包含意見回饋的類型。  | 
|  `arrivalDate`  |  來自回饋報告的 `Arrival-Date` 或 `Received-Date` 欄位值，其格式為 ISO8601 格式 (*YYYY-MM-DDThh:mm:ss.sZ*)。此欄位可能不會在報告中顯示 (因而也不會在 JSON 中顯示)。  | 

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

`complainedRecipients` 欄位包含可能曾提出抱怨的收件人清單。

**重要**  
由於大部分 ISP 都會在投訴通知中編輯曾提出投訴的收件人電子郵件，此清單包含關於可能曾傳送投訴的收件人資訊，根據原始訊息與向我們發出投訴的 ISP 之收件人而產生。Amazon SES 將針對原始訊息執行查詢，以判斷此收件人清單。

在這個清單中的 JSON 物件包含下列欄位。


| 欄位名稱 | Description | 
| --- | --- | 
|  `emailAddress`  |  收件人的電子郵件地址。  | 

### 抱怨類型
<a name="event-publishing-retrieving-firehose-contents-complaint-types"></a>

您可能看到 `complaintFeedbackType` 欄位中由回報 ISP 根據 [Internet Assigned Numbers Authority website](https://www.iana.org/assignments/marf-parameters/marf-parameters.xml#marf-parameters-2) 指派的下列投訴類型：


| 欄位名稱 | Description | 
| --- | --- | 
|  `abuse`  |  指出自動發出的電子郵件或其他形式的電子郵件濫用。  | 
|  `auth-failure`  |  電子郵件身分驗證故障報告。  | 
|  `fraud`  |  指示某些形式的詐騙或網路釣魚活動。  | 
|  `not-spam`  |  指示提供報告的實體不會將訊息視為垃圾郵件。這可能會用於修正內含不正確標籤或者被歸類為垃圾郵件的訊息。  | 
|  `other`  |  指示不符合其他註冊類型的任何其他意見回饋。  | 
|  `virus`  |  回報在原始訊息中找到病毒。  | 

## 交付物件
<a name="event-publishing-retrieving-firehose-contents-delivery-object"></a>

其中包含關於 `Delivery` 事件的 JSON 物件將會有下列欄位。


| 欄位名稱 | Description | 
| --- | --- | 
|  `timestamp`  |  Amazon SES 傳遞電子郵件到收件人的郵件伺服器之日期和時間，以 ISO8601 格式 (*YYYY-MM-DDThh:mm:ss.sZ*) 顯示。  | 
|  `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 物件將會有下列欄位。


| 欄位名稱 | Description | 
| --- | --- | 
|  `reason`  |  電子郵件遭拒的原因。唯一可能的值為 `Bad content`，這表示 Amazon SES 偵測到電子郵件包含病毒。當訊息遭到拒絕時，Amazon SES 會停止處理訊息，且不會嘗試將它遞送到收件人的電子郵件伺服器。  | 

## 開啟物件
<a name="event-publishing-retrieving-firehose-contents-open-object"></a>

其中包含關於 `Open` 事件的 JSON 物件將會包含下列欄位。


| 欄位名稱 | Description | 
| --- | --- | 
|  `ipAddress`  |  收件人的 IP 地址。  | 
|  `timestamp`  |  開啟事件發生時的日期和時間，其格式為 ISO8601 格式 (*YYYY-MM-DDThh:mm:ss.sZ*)。  | 
|  `userAgent`  |  收件人用於開啟電子郵件中的連結的裝置或電子郵件用戶端使用者代理程式。  | 

## 點選物件
<a name="event-publishing-retrieving-firehose-contents-click-object"></a>

其中包含關於 `Click` 事件的 JSON 物件將會包含下列欄位。


| 欄位名稱 | Description | 
| --- | --- | 
|  `ipAddress`  |  收件人的 IP 地址。  | 
|  `timestamp`  |  點擊事件發生時的日期和時間，其格式為 ISO8601 格式 (*YYYY-MM-DDThh:mm:ss.sZ*)。  | 
|  `userAgent`  |  收件人用於點選電子郵件中的連結的用戶端使用者代理程式。  | 
|  `link`  |  收件人點選的 URL 連結。  | 
|  `linkTags`  |  使用 `ses:tags` 屬性新增到連結的標籤清單。如需新增標籤至電子郵件中連結的相關資訊，請參閱 [問題 5：我可以使用獨特的識別碼來標籤連結嗎？](faqs-metrics.md#sending-metric-faqs-clicks-q5) 中的 [Amazon SES 電子郵件傳送指標常見問答集](faqs-metrics.md)。  | 

## 算圖失敗物件
<a name="event-publishing-retrieving-firehose-contents-failure-object"></a>

其中包含 `Rendering Failure` 事件相關資訊的 JSON 物件有下列欄位。


| 欄位名稱 | Description | 
| --- | --- | 
|  `templateName`  |  用於傳送電子郵件的範本名稱。  | 
|  `errorMessage`  |  提供更多關於轉譯失敗資訊的訊息。  | 

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

其中包含 `DeliveryDelay` 事件相關資訊的 JSON 物件有下列欄位。


| 欄位名稱 | Description | 
| --- | --- | 
|  `delayType`  |  延遲的類型。可能值為： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/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` 物件包含下列數值：


| 欄位名稱 | Description | 
| --- | --- | 
|  `emailAddress`  |  導致訊息傳遞延遲的電子郵件地址。  | 
|  `status`  |  與傳遞延遲相關聯的 SMTP 狀態碼。  | 
|  `diagnosticCode`  |  接收訊息傳輸代理程式 (MTA) 所提供的診斷代碼。  | 

## 訂閱物件
<a name="event-publishing-retrieving-firehose-subscription-object"></a>

其中包含 `Subscription` 事件相關資訊的 JSON 物件有下列欄位。


| 欄位名稱 | Description | 
| --- | --- | 
|  `contactList`  |  聯絡人名稱清單為開啟。  | 
|  `timestamp`  |  ISP 傳送訂閱通知時的日期和時間，其格式為 ISO8601 格式 *(YYYY-MM-DDThh:mm:ss.sZ)*。  | 
|  `source`  |  傳送出該訊息的電子郵件地址 (信封的「寄件人」地址)。  | 
|  `newTopicPreferences`  |  JSON 資料結構 (映射) 指定聯絡清單中所有主題的訂閱狀態，顯示更改後的狀態 (已訂閱或已取消訂閱)。  | 
|  `oldTopicPreferences`  |  JSON 資料結構 (映射) 指定聯絡清單中所有主題的訂閱狀態，顯示更改前的狀態 (已訂閱或已取消訂閱)。  | 

### 新/舊主題偏好
<a name="event-publishing-retrieving-firehose-contents-subscription-object-topic-preferences"></a>

`newTopicPreferences` 和 `oldTopicPreferences` 物件包含下列數值：


| 欄位名稱 | Description | 
| --- | --- | 
|  `unsubscribeAll`  |  指定聯絡人是否取消聯絡清單中的所有主題。  | 
|  `topicSubscriptionStatus`  |  在 `topicName` 欄位中指定主題的訂閱狀態，指出主題目前是否訂閱接收來自指定事件類型的 SES 通知。可能的值為 `subscriptionStatus` 欄位中的 **OptIn** （已訂閱） 或 **OptOut** （未訂閱）。  | 
|  `topicDefaultSubscriptionStatus`  |  在 `topicName` 欄位中指定主題的預設訂閱狀態，以判斷新增至事件目的地的新主題是否預設訂閱或取消訂閱。在 `subscriptionStatus` 欄位中，可能的值為 **OptIn** （預設訂閱） 或 **OptOut** （預設取消訂閱）。  | 

# 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 物件包含下列欄位。事件類型會決定有哪些其他物件。


| 欄位名稱 | Description | 
| --- | --- | 
|  `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 物件有下列欄位。


| 欄位名稱 | Description | 
| --- | --- | 
|  `timestamp`  |  傳送訊息的日期和時間，格式為 ISO8601 (*YYYY-MM-DDThh:mm:ss.sZ*)。  | 
|  `messageId`  |  Amazon SES 指派給訊息的專有 ID。您傳送訊息後，Amazon SES 會回傳此數值給您。  此訊息 ID 是由 Amazon SES 指派。您可以在原始電子郵件內 `headers` 物件的 `commonHeaders` 與 `mail` 欄位找到訊息 ID。   | 
|  `source`  |  傳送出該訊息的電子郵件地址 (信封的「寄件人」地址)。  | 
|  `sourceArn`  |  用以傳送電子郵件之身分的 Amazon Resource Name (ARN)。在傳送授權的情況下，`sourceArn` 為身分持有者授權給委託寄件者之身分的 ARN，用以傳送電子郵件。如需關於傳送授權的詳細資訊，請參閱 [電子郵件身分驗證方法使用傳送授權](sending-authorization.md)。  | 
|  `sendingAccountId`  |  用於傳送電子郵件之帳戶的帳戶 AWS ID。在傳送授權的情況下，`sendingAccountId` 為委託寄件者的帳戶 ID。  | 
|  `destination`  |  原始郵件收件人的電子郵件地址清單。  | 
|  `headersTruncated`  |  說明通知中的標題是否已截斷的字串，會在標題大於 10 KB 時顯示。可能值為 `true` 和 `false`。  | 
|  `headers`  |  電子郵件原始標題的清單。清單中的每項標題都有 `name` 欄位與 `value` 欄位。  `headers` 欄位中的任何訊息 ID 都來自於您傳遞給 Amazon SES 的原始訊息。Amazon SES 隨即指派給訊息的訊息 ID 位於 `mail` 物件的 `messageId` 欄位內。   | 
|  `commonHeaders`  |  電子郵件常用的原始標頭映射。  任何 `commonHeaders` 欄位內的訊息 ID 皆為 Amazon SES 隨即指派給訊息的訊息 ID，位於 `mail` 物件的 `messageId` 欄位內。   | 
|  `tags`  |  與電子郵件相關聯的標籤清單。  | 

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

其中包含 `Bounce` 事件相關資訊的 JSON 物件有下列欄位。


| 欄位名稱 | Description | 
| --- | --- | 
|  `bounceType`  |  退信類型，由 Amazon SES 判定。  | 
|  `bounceSubType`  |  退信的副類型，由 Amazon SES 判定。  | 
|  `bouncedRecipients`  |  其中包含遭退信的原始郵件收件人之相關資訊的清單。  | 
|  `timestamp`  |  ISP 傳送退信通知時的日期和時間，其格式為 ISO8601 格式 (*YYYY-MM-DDThh:mm:ss.sZ*)。  | 
|  `feedbackId`  |  退信的唯一 ID。  | 
|  `reportingMTA`  |  來自 DSN 的 `Reporting-MTA` 欄位數值。這是嘗試執行傳遞、轉傳或閘道操作的 Message Transfer Authority (MTA) 值，如 DSN 中所述。  此欄位只有在傳遞狀態通知 (DSN) 與退信連接時才會顯示。   | 

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

退信事件可能與單一收件人或多個收件人相關。`bouncedRecipients` 欄位擁有物件清單 (電子郵件地址發生退信的每個收件人都有一個物件)，且包含下列欄位。


| 欄位名稱 | Description | 
| --- | --- | 
|  `emailAddress`  |  收件人的電子郵件地址。若有可用的 DSN，此為來自 DSN 的 `Final-Recipient` 欄位值。  | 

或者，如果 DSN 連接到退信，也可能會顯示下列欄位。


| 欄位名稱 | Description | 
| --- | --- | 
|  `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` 的退信時，您應該從電子清單中移除對應的電子郵件地址，您將來無法再傳送給他們。當訊息發生多次軟退信時，您會收到 `Transient` 退信，而 Amazon SES 會停止嘗試重新遞送該訊息。未來您也許可以成功重新傳送給一開始導致 `Transient` 退信的地址。


| bounceType | bounceSubType | Description | 
| --- | --- | --- | 
|  `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 物件有下列欄位。


| 欄位名稱 | Description | 
| --- | --- | 
|  `complainedRecipients`  |  清單中包含可能曾提出投訴的收件人相關資訊。  | 
|  `timestamp`  |  ISP 傳送抱怨通知時的日期和時間，其格式為 ISO8601 格式 (*YYYY-MM-DDThh: mm: ss.sZ*)。  | 
|  `feedbackId`  |  投訴的唯一 ID。  | 
|  `complaintSubType`  |  投訴的子類型，由 Amazon SES 判定。  | 

此外，如果意見回饋報告連接到該投訴，可能顯示下列欄位。


| 欄位名稱 | Description | 
| --- | --- | 
|  `userAgent`  |  來自意見回饋報告的 `User-Agent` 欄位數值。這表示產生報告的系統名稱和版本。  | 
|  `complaintFeedbackType`  |  自 ISP 傳送的意見回饋報告中的 `Feedback-Type` 欄位數值。這包含意見回饋的類型。  | 
|  `arrivalDate`  |  來自回饋報告的 `Arrival-Date` 或 `Received-Date` 欄位值，其格式為 ISO8601 格式 (*YYYY-MM-DDThh:mm:ss.sZ*)。此欄位可能不會在報告中顯示 (因而也不會在 JSON 中顯示)。  | 

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

`complainedRecipients` 欄位包含可能曾提出投訴的收件人清單。

**重要**  
大多數 ISP 會修改提出抱怨的收件人之電子郵件地址。因此，`complainedRecipients` 欄位將包含曾收過電子郵件、且地址位於發出抱怨通知的網域內之所有地址的清單。

在這個清單中的 JSON 物件包含下列欄位。


| 欄位名稱 | Description | 
| --- | --- | 
|  `emailAddress`  |  收件人的電子郵件地址。  | 

### 抱怨類型
<a name="event-publishing-retrieving-sns-contents-complaint-types"></a>

您可能看到 `complaintFeedbackType` 欄位中由回報 ISP 根據 [Internet Assigned Numbers Authority website](https://www.iana.org/assignments/marf-parameters/marf-parameters.xml#marf-parameters-2) 指派的下列投訴類型：


| 欄位名稱 | Description | 
| --- | --- | 
|  `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 物件有下列欄位。


| 欄位名稱 | Description | 
| --- | --- | 
|  `timestamp`  |  Amazon SES 傳遞電子郵件到收件人的郵件伺服器之日期和時間，以 ISO8601 格式 (*YYYY-MM-DDThh:mm:ss.sZ*) 顯示。  | 
|  `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 物件有下列欄位。


| 欄位名稱 | Description | 
| --- | --- | 
|  `reason`  |  電子郵件遭拒的原因。唯一可能的值為 `Bad content`，這表示 Amazon SES 偵測到電子郵件包含病毒。當訊息遭到拒絕時，Amazon SES 會停止處理訊息，且不會嘗試將它遞送到收件人的電子郵件伺服器。  | 

## 開啟物件
<a name="event-publishing-retrieving-sns-contents-open-object"></a>

其中包含 `Open` 事件相關資訊的 JSON 物件有下列欄位。


| 欄位名稱 | Description | 
| --- | --- | 
|  `ipAddress`  |  收件人的 IP 地址。  | 
|  `timestamp`  |  開啟事件發生時的日期和時間，其格式為 ISO8601 格式 (*YYYY-MM-DDThh:mm:ss.sZ*)。  | 
|  `userAgent`  |  收件人用於開啟電子郵件中的連結的裝置或電子郵件用戶端使用者代理程式。  | 

## 點選物件
<a name="event-publishing-retrieving-sns-contents-click-object"></a>

其中包含 `Click` 事件相關資訊的 JSON 物件有下列欄位。


| 欄位名稱 | Description | 
| --- | --- | 
|  `ipAddress`  |  收件人的 IP 地址。  | 
|  `timestamp`  |  點擊事件發生時的日期和時間，其格式為 ISO8601 格式 (*YYYY-MM-DDThh:mm:ss.sZ*)。  | 
|  `userAgent`  |  收件人用於點選電子郵件中的連結的用戶端使用者代理程式。  | 
|  `link`  |  收件人點選的 URL 連結。  | 
|  `linkTags`  |  使用 `ses:tags` 屬性新增到連結的標籤清單。如需新增標籤至電子郵件中連結的相關資訊，請參閱 [問題 5：我可以使用獨特的識別碼來標籤連結嗎？](faqs-metrics.md#sending-metric-faqs-clicks-q5) 中的 [Amazon SES 電子郵件傳送指標常見問答集](faqs-metrics.md)。  | 

## 算圖失敗物件
<a name="event-publishing-retrieving-sns-contents-failure-object"></a>

其中包含 `Rendering Failure` 事件相關資訊的 JSON 物件有下列欄位。


| 欄位名稱 | Description | 
| --- | --- | 
|  `templateName`  |  用於傳送電子郵件的範本名稱。  | 
|  `errorMessage`  |  提供更多關於轉譯失敗資訊的訊息。  | 

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

其中包含 `DeliveryDelay` 事件相關資訊的 JSON 物件有下列欄位。


| 欄位名稱 | Description | 
| --- | --- | 
|  `delayType`  |  延遲的類型。可能值為： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/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` 物件包含下列數值：


| 欄位名稱 | Description | 
| --- | --- | 
|  `emailAddress`  |  導致訊息傳遞延遲的電子郵件地址。  | 
|  `status`  |  與傳遞延遲相關聯的 SMTP 狀態碼。  | 
|  `diagnosticCode`  |  接收訊息傳輸代理程式 (MTA) 所提供的診斷代碼。  | 

## 訂閱物件
<a name="event-publishing-retrieving-sns-contents-subscription-object"></a>

其中包含 `Subscription` 事件相關資訊的 JSON 物件有下列欄位。


| 欄位名稱 | Description | 
| --- | --- | 
|  `contactList`  |  聯絡人名稱清單為開啟。  | 
|  `timestamp`  |  ISP 傳送訂閱通知時的日期和時間，其格式為 ISO8601 格式 *(YYYY-MM-DDThh:mm:ss.sZ)*。  | 
|  `source`  |  傳送出該訊息的電子郵件地址 (信封的「寄件人」地址)。  | 
|  `newTopicPreferences`  |  JSON 資料結構 (映射) 指定聯絡清單中所有主題的訂閱狀態，顯示更改後的狀態 (已訂閱或已取消訂閱)。  | 
|  `oldTopicPreferences`  |  JSON 資料結構 (映射) 指定聯絡清單中所有主題的訂閱狀態，顯示更改前的狀態 (已訂閱或已取消訂閱)。  | 

### 新/舊主題偏好
<a name="event-publishing-retrieving-sns-contents-subscription-object-topic-preferences"></a>

`newTopicPreferences` 和 `oldTopicPreferences` 物件包含下列數值：


| 欄位名稱 | Description | 
| --- | --- | 
|  `unsubscribeAll`  |  指定聯絡人是否取消聯絡清單中的所有主題。  | 
|  `topicSubscriptionStatus`  |  在 `topicName` 欄位中指定主題的訂閱狀態，指出主題目前是否訂閱接收來自指定事件類型的 SES 通知。可能的值為 `subscriptionStatus` 欄位中的 **OptIn** （已訂閱） 或 **OptOut** （未訂閱）。  | 
|  `topicDefaultSubscriptionStatus`  |  在 `topicName` 欄位中指定主題的預設訂閱狀態，以判斷新增至事件目的地的新主題是否預設訂閱或取消訂閱。在 `subscriptionStatus` 欄位中，可能的值為 **OptIn** （預設訂閱） 或 **OptOut** （預設取消訂閱）。  | 

# 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. }
```