Sha256: 9ac202d28fdd756efbaab95348d7a3a313fdfdff099607a37870580906f522ee

Contents?: true

Size: 1.21 KB

Versions: 15

Compression:

Stored size: 1.21 KB

Contents

MailQueue
===========

Want to send out your mail asynchronously without having to touch any code that uses the Action Mailer?  

With the plugin installed, all mail send from Mailer gets put into a table called QueuedMails.  Here's my migration to add that table: 


class AddQueuedMailTable < ActiveRecord::Migration
  def self.up
    create_table :queued_mails do |t|
      t.column :object,     :text
      t.column :mailer,     :string
    end
  end

  def self.down
    drop_table :queued_mails
  end
end


Now everytime you call YouMailer.deliver_something(*params), that mail object will be stored in the QueuedMails table.  Just periodically call script/runner from a cron job to process your new mail queue: 

"script/runner 'MailQueue.process' -e production"


If you want to bypass the queue just called the deliver_method_name with an exclamation point at the end.  Like: 

YouMailer.deliver_something!(*params)

WARNING: 

This feature to bypass the queue isn't the same way it was done in the original release of this plugin, so it isn't backwards compatible. Not a huge thing to change, and it probably wasn't a very popular thing used by people using this plugin anyways. 


-Nate
Inkling Inc. 
http://www.inklingmarkets.com

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
spree-0.11.4 vendor/plugins/mail_queue/README
spree-0.11.3 vendor/plugins/mail_queue/README
spree-0.11.2 vendor/plugins/mail_queue/README
spree-0.11.1 vendor/plugins/mail_queue/README
spree-0.11.0 vendor/plugins/mail_queue/README
spree-0.10.2 vendor/plugins/mail_queue/README
spree-0.10.1 vendor/plugins/mail_queue/README
spree-0.10.0 vendor/plugins/mail_queue/README
spree-0.10.0.beta vendor/plugins/mail_queue/README
spree-enriquez-0.9.4 vendor/plugins/mail_queue/README
spree-0.9.4 vendor/plugins/mail_queue/README
spree-0.9.3 vendor/plugins/mail_queue/README
spree-0.9.2 vendor/plugins/mail_queue/README
spree-0.9.1 vendor/plugins/mail_queue/README
spree-0.9.0 vendor/plugins/mail_queue/README