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 Antworten
0
Akzeptierte Antwort

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
beantwortet vor einem Monat
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
EXPERTE
beantwortet vor einem Monat
profile picture
EXPERTE
überprüft vor einem Monat

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen