How to Rate Limit Notification Emails Per User
Without per-user rate limits, one busy event storm floods inboxes and your reputation. Here is how to rate limit notification emails without dropping the urgent ones.
Without a per-user rate limit on notification emails, one busy afternoon can send a single user forty emails, and you have just taught them to filter you into oblivion. Rate limiting notification emails means capping how many you send each user in a window, so an activity storm never turns into an inbox flood. The hard part is doing it without swallowing the notifications that genuinely need to arrive now. The answer is to rate-limit by priority: the ambient stuff gets capped, the urgent stuff always gets through.
Why do I need per-user rate limits at all?
Because event volume is spiky and unbounded. A popular thread gets fifty replies in an hour. A shared document gets edited by a whole team at once. If each event fires an email, one user receives a torrent, and no human wants forty emails about the same thread. They will not read them; they will build a filter, and now your important email is buried with the noise.
There is a reputation cost on top of the annoyance. High-volume, low-value sending drives complaints, and complaints tell mailbox providers your mail is unwanted, which degrades delivery for everyone. Uncapped notification volume is a direct path to the spam folder, one of the quieter reasons transactional-style email lands in spam. A rate limit protects your reputation as much as your user's sanity.
How do I rate limit without dropping urgent emails?
Tier by priority, then apply limits per tier. Security alerts, payment failures, and direct mentions that expect a reply are high priority and bypass the cap, or get a much higher one. Likes, low-value updates, and ambient activity are low priority and get a tight cap. The rule: never let a rate limit swallow an email whose absence causes real harm.
When a low-priority email hits the cap, do not silently drop it. Roll the suppressed events into a digest and send that instead, so the information still reaches the user, just bundled. Rate limiting and batching are two halves of the same strategy: the cap decides you are sending too much, the digest decides what to do about it. I cover the bundling side in how to batch notification emails into a digest; the rate limit is what triggers the batch.
How does a per-user rate limit actually work?
Track a per-user, per-priority counter over a time window. A common shape is a token bucket or a fixed window: each user gets N low-priority emails per hour, and once that is spent, further low-priority sends divert to the next digest instead of going out immediately. High-priority sends check a separate, looser limit or none at all.
Keep the counter in fast shared storage so it holds up under concurrent sends; two events arriving at the same millisecond should not both slip past the cap. And scope the limit correctly: per user, per notification type where it makes sense, not one global cap that lets a chatty feature crowd out a quiet important one.
Make the cap a preference where you can. Some users want every ping; some want almost none. A user-set frequency ("at most one email per hour," "daily only," "never for likes") is a rate limit the user chose, which respects them and cuts your complaints. Let the app react to state and to what the user asked for, not just to raw event volume.
What about the sending side of rate limiting?
There are two rate limits, and people conflate them. One is the product-level cap I have been describing: how many emails a given user should receive. The other is the provider-level send rate: how fast you can push mail without tripping throttling from mailbox providers. Both matter, but they solve different problems. The product cap protects the user's inbox; the send-rate discipline protects your deliverability during bursts.
For the send-rate side, let a provider built for volume smooth the bursts so you are not hammering mailbox providers and getting deferred. Watch your deferral and complaint numbers to know if either limit needs tuning; those are core deliverability metrics that matter. If deferrals climb during storms, your send rate is too aggressive; if complaints climb, your per-user cap is too loose.
Cap the noise, protect the signal
The whole point is signal preservation. A user who trusts that your emails are worth opening is worth ten who filter you. Rate limit the ambient noise hard, let the urgent notifications through untouched, divert the overflow into digests, and give users the controls to set their own pace.
Run it on infrastructure meant for high-volume application mail with real event data. Usermails handles the send side and gives me the delivery events to see whether my caps are working. Tier by priority, cap the low-value stuff per user, digest the overflow, and one busy thread stops turning into forty emails nobody reads.