Note that there are some explanatory texts on larger screens.

plurals
  1. POSending emails based on intervals using Ruby on Rails
    text
    copied!<p>I would like to be able to send a string of emails at a determined interval to different recipients.</p> <p>I assign to each Contact this series of Emails called a Campaign, where Campaign has Email1, Email2, etc. Each Contact has a Contact.start_date. Each Email has email.days which stores the number of days since a Contact's start-date to send the email.</p> <p>For example: Email1.days=5, Email2.days=7, Email3.days=11.</p> <p>Contact1.start_date = 4/10/2010; contact2.start_date = 4/08/2010</p> <p>IF today is 4/15, then Contact1 receives Email 1 (4/15-4/10 = 5 days) IF today is 4/15, then Contact2 received Email 2 (4/15 - 4/8 = 7 days).</p> <p>What's a good action to run every day using a cron job that would then follow these rules to send out emails using ActionMailer?</p> <p>NOTE: The question isn't about using ActionMailer. It is about doing the "math" as well as the execution. Which email to send to whom? I am guessing it has to do with some version of Date - Contact[x].start_date and then compare against email[x].days but I'm not exactly clear how. Thanks.</p> <p>I'd like guidance on whether to use date.today versus time.now as well.</p> <p>Note: the intent is that an individual person may need to schedule individual follow-up on a consistent basis. Rather than having to remember when to follow up which email with whom, it would just follow a pre-determined campaign and send for that person.</p> <p>So it's not a "bulk mail" -- it's really automating the follow-up for individual correspondence.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload