使用「觸發電子郵件」擴充功能管理傳送狀態
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
將文件新增至集合後,擴充功能會擷取文件,以進行電子郵件傳送處理。擴充功能會在處理電子郵件時,在文件中建立及更新 delivery
欄位。
正在處理電子郵件傳送作業
delivery
欄位可填入下列欄位:
- 狀態:
PENDING
、PROCESSING
、SUCCESS
或 ERROR
。
- startTime:開始處理電子郵件的時間戳記。
- endTime:電子郵件處理完成的時間戳記 (即以
SUCCESS
或 ERROR
狀態結束)。
- 錯誤:如果電子郵件傳送失敗,這裡會顯示錯誤訊息。
- attempts:這封電子郵件的傳送嘗試次數。
- leaseExpireTime:如果發生停止或逾時情況,系統應將
PROCESSING
狀態視為錯誤的時間。
- 資訊:成功傳送電子郵件 (至至少一個地址) 後,這個欄位會填入下列欄位:
- messageId:已傳送電子郵件的郵件 ID。
- accepted:電子郵件成功送達的電子郵件地址陣列。
- rejected:無法傳送電子郵件的電子郵件地址陣列。
- 待處理:SMTP 暫時拒絕的電子郵件地址陣列。
- response:SMTP 伺服器的最後一次回應。
電子郵件通常會從 PENDING
傳送至 PROCESSING
,然後傳送至 SUCCESS
或 ERROR
。文件進入 SUCCESS
或 ERROR
狀態後,對文件進行其他變更不會觸發擴充功能傳送另一封電子郵件。如要重新傳送含有文件更新內容的電子郵件,請將 state
變更為 PENDING
或 RETRY
。
手動重試
在某些情況下,電子郵件傳送失敗是可以復原的,或是只要稍做修改,就能手動修正文件並順利傳送。雖然系統不會自動重試,但您可以手動將 delivery
欄位中的 state
改為 RETRY
,讓擴充功能再次嘗試傳送電子郵件 (並增加 attempts
的數量)。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-25 (世界標準時間)。
[null,null,["上次更新時間:2025-07-25 (世界標準時間)。"],[],[],null,["\u003cbr /\u003e\n\nWhen a document is added to the collection, the extension picks it up for email\ndelivery processing. The extension creates and updates a `delivery` field in the\ndocument as it processes the email.\n\nEmail delivery processing\n\nThe `delivery` field can be populated with the following fields:\n\n- **state:** One of `PENDING`, `PROCESSING`, `SUCCESS`, or `ERROR`.\n- **startTime:** Timestamp when email processing began.\n- **endTime:** Timestamp when email processing completed (that is, ended in either a `SUCCESS` or `ERROR` state).\n- **error:** If there was an email delivery error, an error message will be populated here.\n- **attempts:** Number of delivery attempts for this email.\n- **leaseExpireTime:** In case of a hang or timeout, the time at which a `PROCESSING` state should be considered an error.\n- **info:** After successful email delivery (to at least one address), this field will be populated with the following fields:\n - **messageId:** The message ID of the delivered email.\n - **accepted:** Array of email addresses to which the email was successfully delivered.\n - **rejected:** Array of email addresses to which the email could not be delivered.\n - **pending:** Array of email addresses that were temporarily rejected by SMTP.\n - **response:** The last response from the SMTP server.\n\nAn email will typically go from `PENDING` to `PROCESSING` to either `SUCCESS` or\n`ERROR`. Once in the `SUCCESS` or `ERROR` state, additional changes to the\ndocument will not trigger the extension to send another email. To resend an\nemail with document updates, you can change the `state` to `PENDING` or `RETRY`.\n\nManual retries\n\nThere are instances in which email delivery fails in a recoverable fashion or\nthe document can be manually corrected for proper delivery with minor\nmodifications. While retries are not automatic, you can manually change the\n`state` in the `delivery` field to `RETRY` so that the extension attempts email\ndelivery again (and increments the number of `attempts`)."]]