Loading ...
Sorry, an error occurred while loading the content.

Re: [in-phpug] Re: Email scheduling problem

Expand Messages
  • kadapa rajashekhar
    Hey you can do one thing save the user schedule details in DB and run a cron job every hour or day or minute to check any schedule greeting are there if there
    Message 1 of 4 , Mar 7, 2010
    • 0 Attachment
      Hey you can do one thing save the user schedule details in DB and run a cron job every hour or day or minute to check any schedule greeting are there if there are any in DB then fetch and send the greeting this will work.
      If i am not wrong when setting future greetings we will have only date right? no time specific .if so daily once you need to runa cron to check any greetings scheduled for that day.
      Simple right?
      Regards
      Raj





      ________________________________
      From: adithya_radha <adithya_radha@...>
      To: in-phpug@yahoogroups.com
      Sent: Sat, March 6, 2010 11:39:50 AM
      Subject: [in-phpug] Re: Email scheduling problem


      Hi,

      I am not sure about the exact requirement of your application,
      but why not change the logic a bit.

      Rather than dynamically updating the cron file every time there is a request, set the cron job to certain time of the day to call a php file.
      Let this php file connect to be db, find out to whom it should email on that day and trigger the mailing process to those people only.
      This should save a lot of fuss.
      Hope this might help you.

      - Adithya

      --- In in-phpug@yahoogroup s.com, Surajit Koly <chansuro@.. .> wrote:
      >
      > Hi all,
      > I am developing a e-greetings website where 1000s of people register with
      > this site and send greetings via email. There is a concept of email
      > scheduling where people can schedule their email greeting to the future
      > date.
      >
      > I know how to setup cron manually from the control panel. But in this case
      > setting cron manually is not possble. I need some dynamic cron setting
      > script.
      >
      > I am using the below script to set the cron job. But it is not working in
      >
      > ------------ --------- --------- --------- --------- --------
      > <?php
      > function crontab_set ($min, $hour, $monthDay, $monthNum, $weekDay){
      > $command = "MAILTO=chansuro@ ...
      > $min $hour $monthDay $monthNum $weekDay /usr/lib/php -f sendcronemail. php";
      > $cron_file = "cron/Feed_cron" ;
      > // check for Feed_cron file. If it doesn't exist create it.
      > // you must create the file from the browser to associate the proper
      > group
      > if (file_exists( $cron_file) ){ // if it exists, write new command
      >
      > $open = fopen($cron_ file, "w"); // This overwrites current line
      > fwrite($open, $command);
      > fclose($open) ;
      >
      > // this will reinstate your Cron job
      > exec("crontab cron/Feed_cron" );
      >
      > } else { // if it Doesn't exist, Create it then write command
      > touch($cron_ file); // create the file, Directory "cron" must be
      > writeable
      > chmod($cron_ file, 0777); // make new file writeable
      >
      > $open = fopen($cron_ file, "w");
      > fwrite($open, $command);
      > fclose($open) ;
      >
      > // start the cron job!
      > exec("crontab cron/Feed_cron" );
      >
      > }
      >
      > }
      > crontab_set (1, '*', '*', '*', '*');
      > ?>
      > ------------ --------- --------- --------- --------- --------- -
      >
      > Can you please help where is the problem. Also is there any other way to
      > setup email schedules. I am using linux environment.
      >
      > Thanks
      > Surajit
      >
      >
      > [Non-text portions of this message have been removed]
      >







      [Non-text portions of this message have been removed]
    • Team abcphp.com
      Hello, Check out these tutorials http://abcphp.com/search/cron Regards Girish R ... [Non-text portions of this message have been removed]
      Message 2 of 4 , Mar 8, 2010
      • 0 Attachment
        Hello,
        Check out these tutorials http://abcphp.com/search/cron

        Regards
        Girish R

        On Sun, Mar 7, 2010 at 8:41 PM, kadapa rajashekhar <kadaparaj@...>wrote:

        >
        >
        > Hey you can do one thing save the user schedule details in DB and run a
        > cron job every hour or day or minute to check any schedule greeting are
        > there if there are any in DB then fetch and send the greeting this will
        > work.
        > If i am not wrong when setting future greetings we will have only date
        > right? no time specific .if so daily once you need to runa cron to check any
        > greetings scheduled for that day.
        > Simple right?
        > Regards
        > Raj
        >
        > ________________________________
        > From: adithya_radha <adithya_radha@...<adithya_radha%40yahoo.co.in>
        > >
        > To: in-phpug@yahoogroups.com <in-phpug%40yahoogroups.com>
        > Sent: Sat, March 6, 2010 11:39:50 AM
        > Subject: [in-phpug] Re: Email scheduling problem
        >
        >
        > Hi,
        >
        > I am not sure about the exact requirement of your application,
        > but why not change the logic a bit.
        >
        > Rather than dynamically updating the cron file every time there is a
        > request, set the cron job to certain time of the day to call a php file.
        > Let this php file connect to be db, find out to whom it should email on
        > that day and trigger the mailing process to those people only.
        > This should save a lot of fuss.
        > Hope this might help you.
        >
        > - Adithya
        >
        > --- In in-phpug@yahoogroup s.com, Surajit Koly <chansuro@.. .> wrote:
        > >
        > > Hi all,
        > > I am developing a e-greetings website where 1000s of people register with
        > > this site and send greetings via email. There is a concept of email
        > > scheduling where people can schedule their email greeting to the future
        > > date.
        > >
        > > I know how to setup cron manually from the control panel. But in this
        > case
        > > setting cron manually is not possble. I need some dynamic cron setting
        > > script.
        > >
        > > I am using the below script to set the cron job. But it is not working in
        > >
        > > ------------ --------- --------- --------- --------- --------
        > > <?php
        > > function crontab_set ($min, $hour, $monthDay, $monthNum, $weekDay){
        > > $command = "MAILTO=chansuro@ ...
        > > $min $hour $monthDay $monthNum $weekDay /usr/lib/php -f sendcronemail.
        > php";
        > > $cron_file = "cron/Feed_cron" ;
        > > // check for Feed_cron file. If it doesn't exist create it.
        > > // you must create the file from the browser to associate the proper
        > > group
        > > if (file_exists( $cron_file) ){ // if it exists, write new command
        > >
        > > $open = fopen($cron_ file, "w"); // This overwrites current line
        > > fwrite($open, $command);
        > > fclose($open) ;
        > >
        > > // this will reinstate your Cron job
        > > exec("crontab cron/Feed_cron" );
        > >
        > > } else { // if it Doesn't exist, Create it then write command
        > > touch($cron_ file); // create the file, Directory "cron" must be
        > > writeable
        > > chmod($cron_ file, 0777); // make new file writeable
        > >
        > > $open = fopen($cron_ file, "w");
        > > fwrite($open, $command);
        > > fclose($open) ;
        > >
        > > // start the cron job!
        > > exec("crontab cron/Feed_cron" );
        > >
        > > }
        > >
        > > }
        > > crontab_set (1, '*', '*', '*', '*');
        > > ?>
        > > ------------ --------- --------- --------- --------- --------- -
        > >
        > > Can you please help where is the problem. Also is there any other way to
        > > setup email schedules. I am using linux environment.
        > >
        > > Thanks
        > > Surajit
        > >
        > >
        > > [Non-text portions of this message have been removed]
        > >
        >
        > [Non-text portions of this message have been removed]
        >
        >
        >


        [Non-text portions of this message have been removed]
      Your message has been successfully submitted and would be delivered to recipients shortly.