gpt4 book ai didi

aws-sdk - 如何在发送电子邮件时在 Amazon SES 中添加自定义 header 或元数据..?

转载 作者:行者123 更新时间:2023-12-04 11:27:49 27 4
gpt4 key购买 nike

我想在通过 Amazon SES 发送电子邮件时添加一些自定义 header 。我想在通过 Amazon SNS 收到退回通知时获取这些 header 。那么如何在发送电子邮件时传递自定义消息 ID?

现在我正在尝试使用

SendEmailRequest().putCustomRequestHeader(String, String);

但是我没有在 Amazon SNS Notification Bounce JSON 中得到这个 header 。
想法?

最佳答案

两件事情:
首先,您需要使用 RawMessage 来添加自定义 header 。您正在向 SES API 调用添加 header ,而不是向消息本身添加 header 。见 Amazon SES custom header List-Unsubscribe isn't working关于这个话题。
另一个第二个问题是,Amazon SES 最近添加了在由于退回、投诉或取消订阅响应而收到的通知中查看自定义 header 的功能。您必须为任何域明确启用此功能。
您可以在 blog announcement post from June 14, 2016 中阅读更多关于它们的信息。 .

The Amazon SES team is pleased to announce the addition of original email headers to the bounce, complaint, and delivery notifications SES provides through Amazon SNS.

We strive to make your email-sending process easier, and today we’re taking another step in that direction. Increasing your visibility into the feedback you receive from SES has always been a key focus for us. Starting today, the headers you pass to SES in your email-sending requests can be made available in your SNS notifications. Read on for answers to some common questions.

How do I enable this feature?

Use the Amazon SES console or API to configure the notification settings for an identity (email address or domain) and notification type (bounce, complaint, or delivery).

For example, to use the SES console to include the original headers for an identity's bounce notifications, you'd go to the notification settings for an identity and select Include original headers next to the bounce notification configuration:

SES Include Original Headers Settings

After this feature is enabled, the notifications will contain the headers in both raw name/value format and in JSON format for commonly provided headers.

关于aws-sdk - 如何在发送电子邮件时在 Amazon SES 中添加自定义 header 或元数据..?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38201143/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com