
Show HN: Mailrecipe limits the number of emails you send to a user to 1 per day - QueensGambit
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&#x27;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&#x27;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:<p><a href="https:&#x2F;&#x2F;rapidapi.com&#x2F;mailrecipe&#x2F;api&#x2F;mailrecipe" rel="nofollow">https:&#x2F;&#x2F;rapidapi.com&#x2F;mailrecipe&#x2F;api&#x2F;mailrecipe</a><p>Have you run into this problem? How did you solve it?
======
santypk4
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.

~~~
QueensGambit
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 :)

