I want to add some custom headers while sending an email through Amazon SES. I want to fetch those headers at the time of bounce notification through Amazon SNS. So how can I pass custom message id while sending emails?
Right now I'm trying to use
SendEmailRequest().putCustomRequestHeader(String, String);
But I'm not getting this headers in Amazon SNS Notification Bounce JSON. Ideas?
Two things:
First, you need to use a RawMessage to add a custom header. You are adding a header to the SES API call, not to the message itself. See Amazon SES custom header List-Unsubscribe isn't working about this topic.
Other second issue, is Amazon SES added recently the ability to see custom headers in the notifications received due to bounces, complaints or unsubscribe responses. You must explicitly enable this feature for any domain.
You can read more about them in the 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:
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With