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 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南