Automate adding an email addresses to AWS account suppression list

0

We use AWS SES to send email. Sometimes, we encounter complaints, and we would like automatically add such email addresses to the AWS account suppression list. I would appreciate any help in understanding how to solve this task.

I have SNS topic for complaint notifications. Is it possible to automate adding an email address from an SNS complaint notification to the account suppression list?

2回答
0
承認された回答

Thank you very much for the advice! I did a similar thing: SNS topic and Lambda function listening to it. I extracted the email from the notification and used the 'put_suppressed_destination' Boto3 method to add an email address to the suppression list for my account.

I found the following documentation URLs helpful: https://docs.aws.amazon.com/ses/latest/APIReference-V2/API_PutSuppressedDestination.html https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sesv2/client/put_suppressed_destination.html#

Serg
回答済み 1ヶ月前
0

Here's the gist of how you can set it up:

First off, create an SNS topic to catch those complaint notifications. Then, subscribe the SES notification service to this topic. This way, whenever there's a complaint, it'll ping this topic.

Now, when a complaint notification hits this SNS topic, shoot a message over to another SNS topic with the email address that got complained about.

Set up a Lambda function to listen in on this second SNS topic. When it hears about a complained email address, it'll spring into action. The Lambda function's job is to use the ses:AddEmailAddressToSuppressionList API to add that email address to your account's suppression list.

Oh, and if you're feeling fancy, you can also tweak things a bit. For instance, you might want to filter out or process the email addresses before tossing them onto the suppression list. Maybe remove any addresses that have been recently suppressed to keep things tidy.

And there you have it! With this setup, you'll be automating the updating of your suppression list whenever a complaint comes in. No more manual adding of email addresses every time. The SNS topics serve as the link between the SES notifications and the Lambda function that handles the suppression list updates.

profile picture
エキスパート
回答済み 1ヶ月前
profile picture
エキスパート
レビュー済み 1ヶ月前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ