hackclub / hackathons-backend

Powering https://hackathons.hackclub.com
https://hackathons.hackclub.com
MIT License
20 stars 4 forks source link

Use AWS SNS to handle SES Feedback Notifications #461

Open garyhtou opened 5 months ago

garyhtou commented 5 months ago

Whenever we send digests on Tuesdays, HCB gets spammed with hundreds of "Delivery Status Notification (Failure)" emails.

When we receive these notifications, it generally means the email bounced (e.g. email address no longer valid), or there was a complaint (marked as spam). Because of this, we want to unsubscribe the user. Currently, these notifications get sent to hackathons@hackclub.com.

By sending the SES Feedback notification to a AWS SNS Topic, we can then programmatically unsubscribe these users.

image

https://docs.aws.amazon.com/ses/latest/dg/notification-contents.html https://docs.aws.amazon.com/ses/latest/dg/monitor-sending-activity-using-notifications-sns.html

follow up with @MelSmith104 and @alexdevz once completed

garyhtou commented 5 months ago

To provide a bit more info, this Rails app should subscribe to the SNS topic (such as via a webhook) — or even a nightly job is fine — to then process these notifications