genius_supreme Posted June 3, 2010 Share Posted June 3, 2010 Hi guys im new to this forum hope i posted this on the right topic. the scenario: i have a form completed with form validation. This form has to be saved in database. And the details of that particular form information (saved by form ID) has to be emailed to certain people (by mailing group selected in the form which links to another table consisting of the email addresses assigned to that email group) but the tricky part is that it has to be sent as a reminder based on number of days input in the form (reminder_day field) by the user. The form also consist 2 attachment fields which are supposed to be sent as email attachment (the file location is saved in database as attachment_field1 and attachment_field2) Help/idea/suggestion required on: sending out the details as an email reminder including attachment (if there are any) based on the NotifyDate field ("reminder_day field" + current Date) in the Database. This has to be automatically sent when that date arrives (NotifyDate). Sample code preferable for better understanding. Actually this is an Intranet Application for my office. Need your experties. (please refer the attached php form) [attachment deleted by admin] Quote Link to comment Share on other sites More sharing options...
dabaR Posted June 3, 2010 Share Posted June 3, 2010 Hi. I'm new too! So do you have some GNU/Linux servers there, or are you a sucker? Just kidding; the reason I ask is because we use cron jobs, along with an emailing script for tasks like the one you described. Here's the architecture: Every day, at 6AM, a script is ran, that sends out email reminders for db records that have the NotifyDate = current date. The cron job syntax/usage can be learned here: http://www.pantz.org/software/cron/croninfo.html Sending emails with attachments can be done using the SwiftMailer package: http://swiftmailer.org/docs/sending-quickref Quote Link to comment Share on other sites More sharing options...
genius_supreme Posted June 3, 2010 Author Share Posted June 3, 2010 im using WAMP. I have just learnt that cronjob only works for linux so is there any other method to do what i want? Quote Link to comment Share on other sites More sharing options...
phpchamps Posted June 3, 2010 Share Posted June 3, 2010 if you are on windows use scheduler.. write a php script with the logic and set a scheduler... and on that time scheduler will run.. Quote Link to comment Share on other sites More sharing options...
genius_supreme Posted June 3, 2010 Author Share Posted June 3, 2010 hey phpchamps, i was thinking about that but never know the scheduler can run php files. can it? If i create a php file to check on the NotifyDate=CurrentDate and send out the email (another php file) will the scheduler run accordingly? thanks for you reply. Need more infor. Quote Link to comment Share on other sites More sharing options...
phpchamps Posted June 3, 2010 Share Posted June 3, 2010 ya it can run php files.. you and in ur php file u can run ur own logic.. check out this:- http://drupal.org/node/31506 Quote Link to comment Share on other sites More sharing options...
genius_supreme Posted June 3, 2010 Author Share Posted June 3, 2010 ya it can run php files.. you and in ur php file u can run ur own logic.. check out this:- http://drupal.org/node/31506 Thanks phpchamps. I was testing the php file at the time u replied. and it works . thanks for the great article too. now i need to put my scripts together to send the mails out based on the date. Quote Link to comment Share on other sites More sharing options...
phpchamps Posted June 3, 2010 Share Posted June 3, 2010 ur wlcme Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.