crush899
Posts: 22
|
Posted: 06/29/2011, 12:53 AM |
|
Need code or sample for how to generate an email (reminder/notification) message when a user defined date is reached.
|
|
|
beevet
Posts: 47
|
Posted: 06/29/2011, 2:39 AM |
|
Will someone be accessing the web site on this date? If so, you could have a page where the current date is compared to the date stored in the database and send an email if the stored date is the same as the current date. You would need to make sure that page is accessed each day for the script to run.
In the other situation, no one is for sure visiting the site, but you still want a reminder sent. I think that needs to be done with a program scheduled to run automatically on your server, not necessarily through a PHP page. I have wondered about this second scenario and would appreciate any thoughts on how to get this done also. Is this a CRON job type of thing? Does that automatically scheduled program just call the PHP page so it can execute the script?
Chris
|
|
|
jjrjr2
Posts: 131
|
Posted: 06/29/2011, 9:45 PM |
|
You can create a php script in codecharge that will do your mail stuff.
Once you have created that and tested it.. Just remove all the page output in the Before Output event like so..
global $main_block;
$main_block ="";
This will prevent the page from generating any output when run as a CRON task.
Now all you gotta do make a crontab entry for it.
Your CRON statement would be calling the script something like
/pathtophp/php /pathtoyourscript/yourscript.php
Verify you do not need any switches for the php command and then all should be golden..
Have fun
John
_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com
Real Web Development At: http://RealWebDevelopment.us |
|
|
|