Jump to content

Automatic Email Reminders


christo16

Recommended Posts

Hello everybody,

I work for a computer shop and have created a php/mysql system that we use to keep track of all the computers we work on.  How do I make the system that sends out an email based on when the machines are due to be picked up.  It would need to be running all the time, not just send out the email when the user accesses the page with the email code on it.

Thank you for any input!

Link to comment
https://forums.phpfreaks.com/topic/37943-automatic-email-reminders/
Share on other sites

I'm not sure how you have things set up, but you could just write a script that checks for a date and time that the email should be sent, then just use a cronjob to run the script however often you need it. For example, if you will be sending emails out once a day, you could just run the script once a day also, looking for emails that need to be sent that day.

I would probably have the script look for all records that the email send date is older than now, send all of those emails. I would also have a field for emails already sent, so that the SQL would look for all dates older  than now, and the email sent field is false. Once the email is sent, then update the email sent field.

Of course, you could make this as complicated as you want. For example, if an email was sent and the user didn't get the computer in 3 days, another email is sent, etc.

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.