0
I Use This!
Activity Not Available

Project Summary

Sending email can be a bottleneck in your Rails app. Here's a dead simple way of making all your mail be delivered asynchronously.

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
endNow 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

Tags

asynchronous email mail rails ruby

In a Nutshell, mail-queue...

 No code available to analyze

Open Hub computes statistics on FOSS projects by examining source code and commit history in source code management systems. This project has no code locations, and so Open Hub cannot perform this analysis

Is this project's source code hosted in a publicly available repository? Do you know the URL? If you do, click the button below and tell us so that Open Hub can generate statistics! It's fast and easy - try it and see!

Add a code location

MIT License
Permitted

Sub-License

Private Use

Commercial Use

Modify

Distribute

Forbidden

Hold Liable

Required

Include Copyright

Include License

These details are provided for information only. No information here is legal advice and should not be used as such.

All Licenses

This Project has No vulnerabilities Reported Against it

Did You Know...

  • ...
    Black Duck offers a free trial so you can discover if there are open source vulnerabilities in your code
  • ...
    data presented on the Open Hub is available through our API
  • ...
    nearly 1 in 3 companies have no process for identifying, tracking, or remediating known open source vulnerabilities
  • ...
    compare projects before you chose one to use

 No code available to analyze

Open Hub computes statistics on FOSS projects by examining source code and commit history in source code management systems. This project has no code locations, and so Open Hub cannot perform this analysis

Is this project's source code hosted in a publicly available repository? Do you know the URL? If you do, click the button below and tell us so that Open Hub can generate statistics! It's fast and easy - try it and see!

Add a code location

Community Rating

Be the first to rate this project
Click to add your rating
   Spinner
Review this Project!
Sample ohloh analysis