이메일 트리거 확장 프로그램으로 전송 상태 관리
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
문서가 컬렉션에 추가되면 확장 프로그램에서 이메일 전송 처리를 위해 해당 문서를 선택합니다. 확장 프로그램은 이메일이 처리될 때 문서에 delivery
필드를 만들고 업데이트합니다.
이메일 전송 처리
delivery
필드는 다음의 필드로 채워질 수 있습니다.
- state:
PENDING
, PROCESSING
, SUCCESS
또는 ERROR
중 하나입니다.
- startTime: 이메일 처리가 시작된 타임스탬프입니다.
- endTime: 이메일 처리가 완료된 타임스탬프입니다(
SUCCESS
또는 ERROR
상태로 종료).
- error: 이메일 전송 오류가 발생하면 여기에 오류 메시지가 입력됩니다.
- attempts: 이 이메일의 전송 시도 횟수입니다.
- leaseExpireTime: 작업 중단 또는 시간 초과가 발생하는 경우
PROCESSING
상태가 오류로 간주되는 시간입니다.
- info: 하나 이상의 주소로 이메일을 성공적으로 전송한 후 이 필드는 다음의 필드로 채워집니다.
- messageId: 전송된 이메일의 메시지 ID입니다.
- accepted: 이메일이 성공적으로 전송된 이메일 주소의 배열입니다.
- rejected: 이메일을 전송할 수 없는 이메일 주소의 배열입니다.
- pending: SMTP에 의해 일시적으로 거부된 이메일 주소의 배열입니다.
- response: SMTP 서버의 마지막 응답입니다.
일반적으로 이메일은 PENDING
에서 PROCESSING
을 거쳐 SUCCESS
또는 ERROR
로 상태가 전환됩니다. SUCCESS
또는 ERROR
상태가 되면 문서에 추가적인 변경사항이 발생해도 확장 프로그램은 다른 이메일을 전송하지 않습니다. 문서 업데이트로 이메일을 다시 전송하려면 state
를 PENDING
또는 RETRY
로 변경하면 됩니다.
수동 재시도
이메일 전송이 복구 가능한 방식으로 실패하거나 문서를 직접 약간만 수정하여 정상적으로 전송할 수 있는 경우가 있습니다. 재시도는 자동이 아니지만 확장 프로그램이 이메일 전송을 다시 시도하도록 delivery
필드에서 state
를 RETRY
로 수동 변경할 수 있습니다(이 경우 attempts
의 수가 늘어남).
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-08-27(UTC)
[null,null,["최종 업데이트: 2025-08-27(UTC)"],[],[],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`)."]]