Reputation: 23
I am looking to add a feature to my site that would email a client 45 and 30 days before their set event. Can anyone point me in the right direction to starting this as the client names and events are generated by the website.
You can view the site at
http://www.abbyphotography.ca/clients
User: [email protected] Pass: mickeymouse
Just click on view the even and you see the event date table
Upvotes: 0
Views: 1622
Reputation: 794
As Braunson has suggested, setting up a script to do this would definitely be the preferred option. You only need to schedule the script to run once a day, and if it's likely to be processor-intensive then there's no reason why you can't run it first thing in the morning or later on in the evening. What you might want to do is add a column (flag) in your table schema so that the client's record is updated as soon as the notification has been sent.
The important thing to make sure first is that your hosting provider allows you to schedule cron jobs in some way. If this is ok then you just need to write a database query to identify all of the clients that need to be notified, and then put it in a PHP script along with a basic form mailer routine or library. I would be tempted to probably send another notification 10 working days prior to the event, because it's easy to lose track of things after a month (well, it is for me anyway).
Upvotes: 0
Reputation: 717
You could set a script to run a check grab every client, then check each client through the events to see if they have an even, if so is it 45-30 days before that event? If so shoot out an email to them. Loop through the clients until finished.
Set this cron job up to run whenever you want, I don't suggest too frequently tho. You can set this cron job up via your cPanel or other panel depending on your host.
Upvotes: 1