3 ms·
Show HN: Mailrecipe limits the number of emails you send to a user to 1 per day
Last week, I spammed my users with emails by mistake. I had written an idempotent method to do a transaction and send a confirmation email. I didn't realize the email call is not idempotent. So, when the transaction failed, it retried again and again and spammed the entire user base with emails. I was so embarrassed and wrote an API layer on top of my email delivery service (SendGrid) to ensure that my users won't get more than 1 email per day, irrespective of my architecture or mistakes. I am publishing it as a public API, in case anyone else needs it:
https://rapidapi.com/mailrecipe/api/mailrecipe https://rapidapi.com/mailrecipe/api/mailrecipe
Have you run into this problem? How did you solve it?
- santypk4 8y agoWow! I have to check this out. This is a common mistake, especially when you don’t know what the system does if you are new or if you are testing, last week I receive 100 emails from my ex-companye, a new employer run a script on some old staging database, 10.000 emails were sent.
- QueensGambit 8y agoThanks! Yes. That's a common mistake too. Like security, people understand the magnitude of this problem after the fact. All it takes is a dry run or try/catch block by a new member in the team :)