When a user earns 10 points in my application, he gets an email saying "You just earned 10 points!"
If someone earns 10 points per day over a week, I don't mind sending him an email a day – but if someone earns 50 points in a single day, I don't want to send him 5 emails.
So I'd like a way to intercept each outgoing email before it gets sent, examine it, and determine whether I should send it or not. What's the best way to do this?