<?xml version="1.0" encoding="UTF-8"?>
<wiki>
  <body>&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Hooking up the email dispatch for Reminders is quite simple. The only problem is that the mechanism for dispatching the emails to to &lt;span class=&quot;caps&quot;&gt;SMTP&lt;/span&gt; or Sendmail (or whatever you use) is undefined, so you need to implement that part yourself.&lt;/p&gt;
&lt;p&gt;Generally, you&#8217;ll want to make a cron script which in essence runs the following:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
script/runner -e production &quot;Reminder.dispatch_and_clean()&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I suggest looking at the configuration section in &lt;a href=&quot;http://wiki.rubyonrails.com/rails/pages/HowToSendEmailsWithActionMailer&quot;&gt;HowToSendEmailsWithActionMailer&lt;/a&gt; on the rails wiki for configuring ActionMailer.&lt;/p&gt;
&lt;p&gt;An example is as follows, which should be placed in &amp;#8220;config/app_config.yml&amp;#8221; :&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;
email:
  delivery: smtp
  
  # For SMTP
  smtp:
    address: localhost
    domain: localhost
    username: myuser
    password: mypass
    authentication: login

  # For sendmail
  sendmail:
    location: &quot;/usr/sbin/sendmail&quot;
    arguments: &quot;-t -t&quot;
&lt;/code&gt;
&lt;/pre&gt;
&lt;h2&gt;How the Reminders work&lt;/h2&gt;
&lt;p&gt;Every time &lt;code&gt;Reminder.dispatch_and_clean()&lt;/code&gt; is called, RuckSack does the following:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Deletes reminders which have expired (i.e. have been sent and are more than 2 days old)&lt;/li&gt;
	&lt;li&gt;Sends reminders via email which are due&lt;/li&gt;
	&lt;li&gt;Re-schedules reminders which are repeatable&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;As you may have noticed before, reminders that are more than a day old are not included in the reminders list in the web interface. Consequently, if you make a load of reminders and don&amp;#8217;t dispatch them, they will pile up. When you come to send them, they will all be sent &amp;#8211; so beware!&lt;/p&gt;</body>
  <created-at type="datetime">2008-10-23T02:53:52-07:00</created-at>
  <id type="integer">71123</id>
  <permalink>hooking-up-email-for-reminders</permalink>
  <repository-id type="integer">37011</repository-id>
  <title>Hooking up email for reminders</title>
  <updated-at type="datetime">2008-11-02T06:27:05-08:00</updated-at>
  <user-id type="integer">10850</user-id>
</wiki>
