SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Zealot
    Join Date
    Nov 2005
    Location
    Huntington Beach, CA
    Posts
    115
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Non random form recipients

    I have a form and 3 different recipients. I would like to have the form submitted to each of the 3 people in sequence.

    So the form gets submitted now and it goes to recipient 1, 10 minutes later the form is submitted and the info gets sent to recipient 2, 30 minutes later and the info is sent to recipient 3, the next time the form is submitted the info goes back to 1 and so on.

    I know that setting it up for randomizing would be easy. How would I go about a sequence?

    Thanks in advance for any help!
    Rob
    Pier Marketing ◄ Printing and Marketing Collateral - Order Online
    Pier Technologies ◄ Web Development & IT Solutions
    And That's News? ◄ My NEW Blog!!

  2. #2
    An average geek earl-grey's Avatar
    Join Date
    Mar 2005
    Location
    Ukraine
    Posts
    1,403
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Check out cron

  3. #3
    SitePoint Zealot
    Join Date
    Nov 2005
    Location
    Huntington Beach, CA
    Posts
    115
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by earl-grey View Post
    Check out cron
    Thank you for the reply.

    I am not looking for things to work out in a specific time frame. I want the emails to be sent to the recipients in a sequence. So in effect the form cycles through the list of recipients.
    Rob
    Pier Marketing ◄ Printing and Marketing Collateral - Order Online
    Pier Technologies ◄ Web Development & IT Solutions
    And That's News? ◄ My NEW Blog!!

  4. #4
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    So does it matter about the timescale?

    I was thrown by the ten-minute gap idea.
    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona

  5. #5
    An average geek earl-grey's Avatar
    Join Date
    Mar 2005
    Location
    Ukraine
    Posts
    1,403
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, you can do that using cron. Set up a script, which is executed every N minutes, and sends all emails that had to be sent within the past N minutes.

    Accuracy of sending time will depend on the timeout between two consequent script executions.

  6. #6
    SitePoint Zealot
    Join Date
    Nov 2005
    Location
    Huntington Beach, CA
    Posts
    115
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by earl-grey View Post
    Well, you can do that using cron. Set up a script, which is executed every N minutes, and sends all emails that had to be sent within the past N minutes.

    Accuracy of sending time will depend on the timeout between two consequent script executions.
    Let me try to explain a bit better.

    The form is a quote form. We do not want the form to go to all of the sales people when it is submitted. We want the sales form to cycle through the sales associates.

    So if the form is submitted now the submitted info will go to sales associate A, the next time it is submitted the info will go to associate B. The next time the info will go to associate C. then the next time the form is submitted the info will go back to associate A and so on.

    I hope this makes more sense.
    Rob
    Pier Marketing ◄ Printing and Marketing Collateral - Order Online
    Pier Technologies ◄ Web Development & IT Solutions
    And That's News? ◄ My NEW Blog!!

  7. #7
    An average geek earl-grey's Avatar
    Join Date
    Mar 2005
    Location
    Ukraine
    Posts
    1,403
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by WebRob View Post
    Let me try to explain a bit better.

    The form is a quote form. We do not want the form to go to all of the sales people when it is submitted. We want the sales form to cycle through the sales associates.

    So if the form is submitted now the submitted info will go to sales associate A, the next time it is submitted the info will go to associate B. The next time the info will go to associate C. then the next time the form is submitted the info will go back to associate A and so on.

    I hope this makes more sense.
    Makes sense. You can store id of the last sales associate the form was sent to. Then fetch id of the next associate like this:
    Code sql:
    SELECT id
      FROM sales_associates
     WHERE id > $last_id
    ORDER
        BY id
     LIMIT 1
    If the query above returns no results, then run this query:
    Code sql:
    SELECT id
      FROM sales_associates
    ORDER
        BY id
     LIMIT 1
    After that update last sales associate id.

  8. #8
    SitePoint Zealot
    Join Date
    Nov 2005
    Location
    Huntington Beach, CA
    Posts
    115
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK...this sounds good. I was thinking something along these lines. I couldn't quite visualize it though.

    Thanks for your help!!
    Rob
    Pier Marketing ◄ Printing and Marketing Collateral - Order Online
    Pier Technologies ◄ Web Development & IT Solutions
    And That's News? ◄ My NEW Blog!!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •