title: Sending emails based on intervals using Ruby on Rails
body: <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:  <code>Email1.days=5, Email2.days=7, Email3.days=11</code></p>
  <p><code>Contact1.start_date = 4/10/2010; contact2.start_date = 4/08/2010</code></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 &quot;math&quot; 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 <code>date.today</code> versus <code>time.now</code> 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 &quot;bulk mail&quot; -- it's really automating the follow-up for individual correspondence.</p>