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 18:50:52 -0700 2008
commit  d039d176883b1ef37c2ee94d2b3ab208587fe1b4
tree    bc20ac05b0eaa0c5211f1715775efffae55ba913
parent  3353510f91c5e30129bb0861ec420505a0fcb61b
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