hackclub / hackathons-backend

Powering https://hackathons.hackclub.com

Home Page:https://hackathons.hackclub.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use AWS SNS to handle SES Feedback Notifications

garyhtou opened this issue · comments

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

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