Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.