public
Description: Deliver email to local db and have it send by sequel_sendmail later. Attempt at a clone of ar_mailer for merb + sequel.
Clone URL: git://github.com/bricooke/sequel_mailer.git
commit  2b0f38752d0817fd0418fd6506769a5c0f87aeea
tree    2d924c7716a63901a2bcf7360b7a8733f7c61dc9
sequel_mailer / README
100644 46 lines (33 sloc) 0.964 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
sequel_mailer
=============
 
My attempt at a clone of ar_mailer (http://seattlerb.rubyforge.org/ar_mailer/) for Merb 0.9.1+ and the Sequel ORM.
 
Status
=============
The plugin can be used in your merb app, but there's nothing to send the mail yet.
 
 
Using
=============
+ Create the migration for your model (Assumes model will be named Email):
 
class EmailMigration < Sequel::Migration
  def up
    create_table "emails" do
      primary_key :id
      varchar :from_address
      varchar :to_address
      varchar :last_send_attempt, :default => 0
      text :mail
      datetime :created_on
    end
  end
 
  def down
    execute "DROP TABLE emails"
  end
end
 
 
+ Set the delivery_method and class to be used:
 
Merb::Mailer.delivery_method = :sequel
Merb::Mailer.config = {:sequel_mailer_class => Email}
 
+ Enjoy
 
 
TODO
=============
+ Write specs for the mailer
+ Write the sequel_sendmail daemon
+ Write a generator for the migration and setting the config