Using PHP, I have a query that goes through my DB looking for pending tasks with reminder triggers at certain times of the day. I have a cronjob that runs every 10 mins and chec
We have a similar system(this is a ASP.NET app so we have services to run this using a internal scheduler... but the details are unimportant). We have one large message queue table that contains the email data to be sent, a to address and the subject line(the actual emails are generated from templates). The way our system works is that once a row is populated we immediately trigger a send task that gathers all the pending emails and sends them. It attempts to send them 3 times and if that fails they are put into a failed resent state. We have a cron like job that runs every 5 mins to sweep up any failed tasks(thing very rarely fail, if they due it is a network problem 99% of the time).