0

我有一个用户将输入下一个事件的日期。它以 yyyy-mm-dd hh:mm:ss 格式(例如:2013-06-09 00:00:00)保存在 MySQL 数据库中。如何编写一个 cron 作业,提前 3 天向用户发送有关即将发生的事件的通知?

4

1 回答 1

2

You can achieve this in two steps:

  1. You have to write a PHP script that checks in your database if there is an event coming up three days from now and if so, which user in your database created that event. If there's an event, the script sends a reminder email to the user.
  2. In cron you create a task that runs the above mentioned script once a day.

Now that you know the steps, please try to figure out the implementation yourself.

于 2013-07-05T09:32:36.100 回答