How to schedule emails to send out

前端 未结 5 1640
独厮守ぢ
独厮守ぢ 2021-02-06 11:57

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

5条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-06 12:24

    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).

提交回复
热议问题