Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Show HN: Mailrecipe limits the number of emails you send to a user to 1 per day
6 points by QueensGambit on Feb 18, 2019 | hide | past | favorite | 2 comments
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

Have you run into this problem? How did you solve it?



Wow! 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.


Thanks! 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 :)




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: