EMAIL REMINDER

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
nachoman316
Forum Newbie
Posts: 12
Joined: Sat Apr 11, 2009 6:40 am

EMAIL REMINDER

Post by nachoman316 »

Hi folks hope all are well.

At the moment I am trying to create an email reminder that will be sent out automatically 2 days before a specific event to people who have registered their email address.

Any Ideas as how to get started on this?
User avatar
jayshields
DevNet Resident
Posts: 1912
Joined: Mon Aug 22, 2005 12:11 pm
Location: Leeds/Manchester, England

Re: EMAIL REMINDER

Post by jayshields »

You can either use a cron job, or find some sort of event which happens often (in your case once per day will be enough) and use it as a trigger.

For example, every time someone logs in, check the database for email reminders that need to be sent today, and if there is any then send them.
nachoman316
Forum Newbie
Posts: 12
Joined: Sat Apr 11, 2009 6:40 am

Re: EMAIL REMINDER

Post by nachoman316 »

Thanks for the swift reply thats great.

Could I set up the php script so it sends the reminder 2days before the event if I set the cron job to execute every day.

Im just having trouble trying to execute the php query. Can you tell the query to send an email 2 days before an event date?

If so do you have a mock example it would be greatly appreciated.

Thanks again.
mattpointblank
Forum Contributor
Posts: 304
Joined: Tue Dec 23, 2008 6:29 am

Re: EMAIL REMINDER

Post by mattpointblank »

Look up the date of the event, compare it to the current date, if it's two days or less, send the email.
Post Reply