Plugin that provides mail queueing functionality on top of merb-mailer
Ruby
Pull request Compare This branch is 3 commits ahead of lachie:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
spec
.gitignore
LICENSE
README
Rakefile
TODO
merb_mail_queue.gemspec

README

merb_mail_queue
===============

A plugin for the Merb framework that provides mail queueing functionality.
Instead of sending emails right away, this plugin queues them into database
table and provides simple processor that loads queue and does send out in the
background.

Setup
===============

Add dependencies in your init file like this:

dependencies "merb-mailer", "merb_mail_queue"


Set up configuration and load plugin in after_app_loads hook. This plugin has
two configuration options: adapter name (only ActiveRecord is supported at the moment)
and mail queue job model class name. So it may look like this in the end.

Queue processor assumed to use your application mailer configuration.

Merb::BootLoader.after_app_loads do
  Merb::Plugins.config[:merb_mail_queue] = {
    :mail_queue_job_model_class_name => "MailQueueJob",
    :adapter                         => :activerecord
  }
  
  Merb::MailQueue.load_plugin!
  
  Merb::Mailer.config = {
    :host   => 'mail.your-domain.com',
    :port   => '25',
    :user   => 'webmaster',
    :pass   => 'supersecret',
    :auth   => :plain, # :plain, :login, :cram_md5, the default is no auth
    :domain => "your-domain.com" # the HELO domain provided by the client to the server
  }
end