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
Search Repo:
bricooke (author)
Sat Mar 15 19:38:01 -0700 2008
commit  86137a94f79e2772e53c092a4b1e29e1903719f4
tree    86a18f0055430aefd3bcdf7a3509325ba512b3b2
parent  d039d176883b1ef37c2ee94d2b3ab208587fe1b4
README
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