

**支援終止通知：**2026 年 10 月 30 日， AWS 將結束對 Amazon Pinpoint 的支援。2026 年 10 月 30 日之後，您將無法再存取 Amazon Pinpoint 主控台或 Amazon Pinpoint 資源 (端點、區段、行銷活動、旅程和分析)。如需詳細資訊，請參閱 [Amazon Pinpoint 終止支援](https://docs.aws.amazon.com/console/pinpoint/migration-guide)。**注意：**與 SMS、語音、行動推播、OTP 和電話號碼驗證相關的 APIs 不受此變更影響，並受 AWS 最終使用者傳訊支援。

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

# 從 Amazon Pinpoint 傳送電子郵件事件資料串流
<a name="event-streams-data-email"></a>

如果您使用 Amazon Pinpoint 傳送電子郵件，Amazon Pinpoint 可以串流這些電子郵件的事件資料。設定事件串流之後，Amazon Pinpoint 會從您在設定期間指定的目的地擷取事件資料，供您檢視。如需如何設定事件串流的資訊，請參閱 [設定 Amazon Pinpoint 透過 Amazon Kinesis 或 Amazon Data Firehose 串流應用程式事件資料](event-streams-setup.md)。Amazon Pinpoint 會串流電子郵件訊息的下列事件類型相關資料：
+ 傳送
+ 交付
+ 退信
+ 投訴
+ 開啟數
+ 點按數
+ 拒絕
+ 取消訂閱
+ 轉譯失敗

這些事件類型會在 中詳細說明[電子郵件事件屬性](#event-streams-data-email-attributes)。

根據您用來傳送電子郵件訊息的 API 和設定，您可能會看到其他事件類型或不同的資料。假設您使用將事件資料發佈到 Amazon Kinesis 的組態集傳送訊息 (例如 Amazon Simple Email Service (Amazon SES) 提供的組態集)，則資料也可以包含範本轉譯失敗的事件。如需該資料的相關資訊，請參閱 *Amazon Simple Email Service 開發人員指南*中的[使用 Amazon SES 事件發佈進行監控](https://docs.aws.amazon.com/ses/latest/dg/monitor-using-event-publishing.html)。您必須先設定事件串流，才能檢視事件，請參閱 [設定 Amazon Pinpoint 透過 Amazon Kinesis 或 Amazon Data Firehose 串流應用程式事件資料](event-streams-setup.md)。設定事件串流時，您可以指定要儲存事件資料的目的地，然後使用目的地來擷取事件資料以供檢視。

## 電子郵件事件範例
<a name="event-streams-data-email-example"></a>

**電子郵件傳送**  
*「電子郵件傳送」*事件的 JSON 物件包含以下範例所示的資料。

```
{
  "event_type": "_email.send",
  "event_timestamp": 1564618621380,
  "arrival_timestamp": 1564618622025,
  "event_version": "3.1",
  "application": {
    "app_id": "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6",
    "sdk": {}
  },
  "client": {
    "client_id": "9a311b17-6f8e-4093-be61-4d0bbexample"
  },
  "device": {
    "platform": {}
  },
  "session": {},
  "attributes": {
    "feedback": "received"
  },
  "awsAccountId": "123456789012",
  "facets": {
    "email_channel": {
      "mail_event": {
        "mail": {
          "message_id": "0200000073rnbmd1-mbvdg3uo-q8ia-m3ku-ibd3-ms77kexample-000000",
          "message_send_timestamp": 1564618621380,
          "from_address": "sender@example.com",
          "destination": ["recipient@example.com"],
          "headers_truncated": false,
          "headers": [{
            "name": "From",
            "value": "sender@example.com"
          }, {
            "name": "To",
            "value": "recipient@example.com"
          }, {
            "name": "Subject",
            "value": "Amazon Pinpoint Test"
          }, {
            "name": "MIME-Version",
            "value": "1.0"
          }, {
            "name": "Content-Type",
            "value": "multipart/alternative;  boundary=\"----=_Part_314159_271828\""
          }],
          "common_headers": {
            "from": "sender@example.com",
            "to": ["recipient@example.com"],
            "subject": "Amazon Pinpoint Test"
          }
        },
        "send": {}
      }
    }
  }
}
```

**電子郵件已交付**  
*「電子郵件已交付」*事件的 JSON 物件包含以下範例所示的資料。

```
{
  "event_type": "_email.delivered",
  "event_timestamp": 1564618621380,
  "arrival_timestamp": 1564618622690,
  "event_version": "3.1",
  "application": {
    "app_id": "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6",
    "sdk": {}
  },
  "client": {
    "client_id": "e9a3000d-daa2-40dc-ac47-1cd34example"
  },
  "device": {
    "platform": {}
  },
  "session": {},
  "attributes": {
    "feedback": "delivered"
  },
  "awsAccountId": "123456789012",
  "facets": {
    "email_channel": {
      "mail_event": {
        "mail": {
          "message_id": "0200000073rnbmd1-mbvdg3uo-q8ia-m3ku-ibd3-ms77kexample-000000",
          "message_send_timestamp": 1564618621380,
          "from_address": "sender@example.com",
          "destination": ["recipient@example.com"],
          "headers_truncated": false,
          "headers": [{
            "name": "From",
            "value": "sender@example.com"
          }, {
            "name": "To",
            "value": "recipient@example.com"
          }, {
            "name": "Subject",
            "value": "Amazon Pinpoint Test"
          }, {
            "name": "MIME-Version",
            "value": "1.0"
          }, {
            "name": "Content-Type",
            "value": "multipart/alternative;  boundary=\"----=_Part_314159_271828\""
          }],
          "common_headers": {
            "from": "sender@example.com",
            "to": ["recipient@example.com"],
            "subject": "Amazon Pinpoint Test"
          }
        },
        "delivery": {
          "smtp_response": "250 ok:  Message 82080542 accepted",
          "reporting_mta": "a8-53.smtp-out.amazonses.com",
          "recipients": ["recipient@example.com"],
          "processing_time_millis": 1310
        }
      }
    }
  }
}
```

**電子郵件點按**  
*「電子郵件點按」*事件的 JSON 物件包含以下範例所示的資料。

```
{
  "event_type": "_email.click",
  "event_timestamp": 1564618621380,
  "arrival_timestamp": 1564618713751,
  "event_version": "3.1",
  "application": {
    "app_id": "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6",
    "sdk": {}
  },
  "client": {
    "client_id": "49c1413e-a69c-46dc-b1c4-6470eexample"
  },
  "device": {
    "platform": {}
  },
  "session": {},
  "attributes": {
    "feedback": "https://aws.amazon.com/pinpoint/"
  },
  "awsAccountId": "123456789012",
  "facets": {
    "email_channel": {
      "mail_event": {
        "mail": {
          "message_id": "0200000073rnbmd1-mbvdg3uo-q8ia-m3ku-ibd3-ms77kexample-000000",
          "message_send_timestamp": 1564618621380,
          "from_address": "sender@example.com",
          "destination": ["recipient@example.com"],
          "headers_truncated": false,
          "headers": [{
            "name": "From",
            "value": "sender@example.com"
          }, {
            "name": "To",
            "value": "recipient@example.com"
          }, {
            "name": "Subject",
            "value": "Amazon Pinpoint Test"
          }, {
            "name": "MIME-Version",
            "value": "1.0"
          }, {
            "name": "Content-Type",
            "value": "multipart/alternative;  boundary=\"----=_Part_314159_271828\""
          }, {
            "name": "Message-ID",
            "value": "null"
          }],
          "common_headers": {
            "from": "sender@example.com",
            "to": ["recipient@example.com"],
            "subject": "Amazon Pinpoint Test"
          }
        },
        "click": {
          "ip_address": "72.21.198.67",
          "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.2 Safari/605.1.15",
          "link": "https://aws.amazon.com/pinpoint/"
        }
      }
    }
  }
}
```

**電子郵件開啟**  
*「電子郵件開啟」*事件的 JSON 物件包含以下範例所示的資料。

```
{
  "event_type": "_email.open",
  "event_timestamp": 1564618621380,
  "arrival_timestamp": 1564618712316,
  "event_version": "3.1",
  "application": {
    "app_id": "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6",
    "sdk": {}
  },
  "client": {
    "client_id": "8dc1f651-b3ec-46fc-9b67-2a050example"
  },
  "device": {
    "platform": {}
  },
  "session": {},
  "attributes": {
    "feedback": "opened"
  },
  "awsAccountId": "123456789012",
  "facets": {
    "email_channel": {
      "mail_event": {
        "mail": {
          "message_id": "0200000073rnbmd1-mbvdg3uo-q8ia-m3ku-ibd3-ms77kexample-000000",
          "message_send_timestamp": 1564618621380,
          "from_address": "sender@example.com",
          "destination": ["recipient@example.com"],
          "headers_truncated": false,
          "headers": [{
            "name": "From",
            "value": "sender@example.com"
          }, {
            "name": "To",
            "value": "recipient@example.com"
          }, {
            "name": "Subject",
            "value": "Amazon Pinpoint Test"
          }, {
            "name": "MIME-Version",
            "value": "1.0"
          }, {
            "name": "Content-Type",
            "value": "multipart/alternative;  boundary=\"----=_Part_314159_271828\""
          }, {
            "name": "Message-ID",
            "value": "null"
          }],
          "common_headers": {
            "from": "sender@example.com",
            "to": ["recipient@example.com"],
            "subject": "Amazon Pinpoint Test"
          }
        },
        "open": {
          "ip_address": "72.21.198.67",
          "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko)"
        }
      }
    }
  }
}
```

## 電子郵件事件屬性
<a name="event-streams-data-email-attributes"></a>

本節定義了 Amazon Pinpoint 在您傳送電子郵件訊息時產生的事件串流資料先前範例中包含的屬性。


| 屬性 | 描述 | 
| --- | --- | 
| event\$1type |  事件的類型。可能值為： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/pinpoint/latest/developerguide/event-streams-data-email.html)  | 
| event\$1timestamp |  傳送訊息的時間，以 Unix 時間顯示 (毫秒)。一般而言，此值在所有針對訊息產生的事件中都是相同的。  | 
| arrival\$1timestamp |  Amazon Pinpoint 收到事件的時間，顯示為 Unix 時間 (以毫秒為單位)。  | 
| event\$1version |  事件 JSON 結構描述的版本。  在您的事件處理應用程式中檢查此版本，讓您知道何時更新應用程式以回應結構描述更新。   | 
| application |  與事件相關聯的 Amazon Pinpoint 專案的資訊。如需詳細資訊，請參閱「應用程式」**表。  | 
| client |  回報事件之裝置上安裝的應用程式用戶端資訊。如需詳細資訊，請參閱*用戶端*表。  | 
| device |  回報事件的裝置資訊。如需詳細資訊，請參閱*裝置*表。 若為電子郵件事件，此物件為空。  | 
| session | 若為電子郵件事件，此物件為空。 | 
| attributes |  與事件相關聯的屬性。如需詳細資訊，請參閱*屬性*表。 若為您應用程式之一所報告的事件，此物件可包含由應用程式定義的自訂屬性。若為您傳送來自行銷活動或旅程的訊息時所建立的事件，此物件可包含與行銷活動或旅程相關聯的屬性。若為您傳送交易訊息時所產生的事件，此物件可包含訊息本身的相關資訊。  | 
| client\$1context | 如為電子郵件事件，此物件包含 custom 物件，且此物件包含 legacy\$1identifier 屬性。legacy\$1identifier 屬性的值是訊息傳送來源的專案 ID。 | 
| facets |  關於訊息的其他資訊，例如電子郵件標題。如需詳細資訊，請參閱「面向」**表。  | 
| awsAccountId |  用來傳送訊息 AWS 的帳戶 ID。  | 

### 應用程式
<a name="event-streams-data-email-attributes-application"></a>

包含與事件相關聯的 Amazon Pinpoint 專案資訊。


| 屬性 | 描述 | 
| --- | --- | 
| app\$1id |  回報事件的 Amazon Pinpoint 專案的唯一 ID。  | 
| sdk |  過去用來報告事件的開發套件。如果您透過直接呼叫 Amazon Pinpoint API 或使用 Amazon Pinpoint 主控台傳送交易電子郵件，此物件會是空的。  | 

### Attributes
<a name="event-streams-data-email-attributes-attrs"></a>

包含產生事件的行銷活動或旅程相關資訊。

#### Campaign
<a name="event-streams-data-email-attributes-attrs-campaigns"></a>

包含產生事件的行銷活動資訊。


| 屬性 | 描述 | 
| --- | --- | 
| feedback |  若為 `_email.click` 事件，此屬性的值為收件人在訊息中點按以產生事件的連結 URL。若為其他事件，此值代表事件類型 (例如 `received`、`opened` 或 `clicked`)。  | 
| treatment\$1id |  如果訊息曾使用 A/B 測試行銷活動傳送，則此值代表訊息的處理方式號碼。若為標準行銷活動和交易電子郵件訊息，此值為 `0`。  | 
| campaign\$1activity\$1id | 事件發生時，Amazon Pinpoint 產生的唯一 ID。 | 
| campaign\$1id |  傳送訊息的行銷活動唯一 ID。  | 

#### 旅程
<a name="event-streams-data-email-attributes-attrs-journey"></a>

包含產生事件的旅程相關資訊。


| 屬性 | 描述 | 
| --- | --- | 
| journey\$1run\$1id | 傳送訊息的旅程的唯一 ID。Amazon Pinpoint 會自動產生這個 ID，並指派給每個新的旅程執行。 | 
| feedback |  若為 `_email.click` 事件，此屬性的值為收件人在訊息中點按以產生事件的連結 URL。若為其他事件，此值代表事件類型 (例如 `received`、`delivered` 或 `opened`)。  | 
| journey\$1id | 傳送訊息的旅程唯一 ID。 | 
| journey\$1activity\$1id | 傳送郵件的旅程活動唯一 ID。 | 

### 用戶端
<a name="event-streams-data-email-attributes-client"></a>

行銷活動或旅程鎖定的用戶端的唯一識別符。


| 屬性 | 描述 | 
| --- | --- | 
| client\$1id | 用戶端的 ID。該值是行銷活動和旅程的端點 ID，對於交易傳送則是 UUID。 | 

### 面向
<a name="event-streams-data-email-attributes-facets"></a>

包含訊息和事件類型的相關資訊。


| 屬性 | 描述 | 
| --- | --- | 
| email\$1channel |  包含 `mail_event` 物件，其包含兩個物件：`mail` 以及與事件類型對應的物件。  | 

### Mail
<a name="event-streams-data-email-attributes-mail"></a>

包含電子郵件訊息內容的相關資訊，以及有關訊息的中繼資料。


| 屬性 | 描述 | 
| --- | --- | 
| message\$1id |  訊息的唯一 ID。Amazon Pinpoint 接受訊息時，會自動產生這個 ID。  | 
| message\$1send\$1timestamp |  訊息傳送的日期和時間，以 [RFC 822](https://datatracker.ietf.org/doc/html/rfc822) 中指定的格式。  | 
| from\$1address |  訊息傳送來源的電子郵件地址。  | 
| destination |  陣列，訊息曾傳送至其包含的電子郵件地址。  | 
| headers\$1truncated |  指出電子郵件標題是否遭截斷的布林值。  | 
| headers |  物件，其包含的數個名稱/值對會對應到訊息中的標題。此物件通常包含下列標頭的資訊： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/pinpoint/latest/developerguide/event-streams-data-email.html)  | 
| common\$1headers |  包含電子郵件訊息的多個常見標題相關資訊。這些資訊可能包括訊息送出的日期、收件人、寄件者及訊息的主旨列。  | 