gulam
Posts: 55
|
Posted: 11/13/2011, 3:27 AM |
|
Hi,
I am developing a membership module using CCS 4.3 where I need to send reminder emails to members automatically 30 and 15 days before membership expiry. How do I achieve this sending of reminders automatically without admin intervention?
Any help would be appreciated.
Thanks
Gula,
|
|
|
Gena
Posts: 591
|
Posted: 11/13/2011, 4:02 AM |
|
create php script and run it via CRON
_________________
Gena |
|
|
gulam
Posts: 55
|
Posted: 11/13/2011, 5:05 AM |
|
Hi Gena,
Thanks for your help.
I however required a little more help on how to write that php script itself that would read all membership records and send an email based on date. Would appreciate any sample code that can do this.
Thanks
Gulam
|
|
|
kevstev01
Posts: 1
|
Posted: 11/16/2011, 4:26 AM |
|
Quote gulam:
I however required a little more help on how to write that php script itself that would read all membership records and send an email based on date. Would appreciate any sample code that can do this.
Hi Gulam - the exact code will depend on your database structure, as you will need to write an SQL statement that selects the appropriate records (e.g. use the DateDiff SQL function to compare the date information), but the way I achieved this on a Windows platform is to create a batch file that uses WGET to retrieve a CodeCharge page that has no controls, and in the "Page BeforeShow" event add the code that connects to your database, performs the record selection query and loops through the record set, and with a SECOND database connection read the information from the user account (i.e. email address, name etc) and use a SMTP email send class (I used PHPMailerLite) to deliver the mail.
As there is no visual output, I recommend adding logging information too, so that you can trace what mail has been sent, to whom and at what time.
_________________
Kevin Stevens
e-Business consultant
www.joinitup.co.uk
|
|
|
|