Jump to content

Trying to create a cron job that will send an email if a value in the database meets certain criteria


alexandervj

Recommended Posts

Hi,

 

I have a MySQL database filled with data from product sheet requests. On our website we have a modal that allows users to request our product sheets. The requests get sent to the database, and also emailed to the group who are responsible for responding to the requests.

 

I would like to set up a cron job to run a php script that connects to the database, then checks to see if a request is older that 24 hours, if it has been marked as 'responded to', - if it is older than 24 hours and not marked as 'responded to' then I want it to send an email reminder to the group that is responsible for responding to the requests.

 

I've been using CodeIgniter so I'm a little rusty on plain PHP and I'm not sure how to go about this. Any help you can give is much appreciated!

What have you tried so far? Break your problem down to separate parts - first the query to find the desired data, then the script to do all the work and finally (once debugged) create the cron setup for your script.

 

So - show us the code to interrogate your db.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.