I want to be able to send emails automatically based on mysql dates.
I know I can schedule them using Crontabs, but the problem is that Crontabs only specifies days, months, weeks etc. – it isn’t specific enough..
The MySQL table is filled with different dates. I want it so that I can automatically send emails when it is say, 3 months from the date on a particular record.
Does anyone know what I can do?
Schedule a cron that runs once a day that checks for records that need an email to be sent that day.
Imagine you had a column like
notify_atwhich is a datetime – then every day your cron basically doesSELECT * FROM records WHERE notify_at = DATE(NOW())Your cron can be stored in
/etc/cron.d/etc/cron.d/send_reminders:Where the contents of the script is your logic, in psuedo-code: