Sending Morning Emails
NOTE: I originally wrote this when I was still working on Stride. I’ve reposted it here for posterity. Here is the original post.
Reliably delivering time-based emails (daily, weekly, etc.) to users has always been a little tricky for web-based applications. There are multiple possible failure points, and we need to contend with different time zones.
Currently, Stride sends two time-based emails:
- Your Monday morning weekly recap
- Task reminders
We wanted both of these emails to arrive in the user’s inbox in the morning. At first, this seems like a simple specification; we’ll just send the emails off at 7am.
But hold on a minute — if we send the Monday morning email at 7am PST, users in New York won’t get their email until 10am, and even worse, our users in Australia won’t get it until 1am on Tuesday; that certainly isn’t Monday morning. What if we send it early enough so that everyone gets it before Monday morning? Unfortunately, if we send the it at 7am in eastern Australia, our users in Hawaii will get their Monday morning email at 11am on Sunday. That just isn’t going to cut it.
We decided to batch up the emails and send them off depending on each user’s time zone. Here’s how it works:
Read on →