Skip to content

QueueClassic/qc-mailer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QueueClassic Mailer

Add to a Rails 3.x project to send email in the background using QueueClassic.

This gem was inspired by ResqueMailer, https://github.com/zapnap/resque_mailer

WARNING: USE AT OWN RISK! THIS GEM IS CONSIDERED EXTREME ALPHA!

Build Status Code Climate

Usage

Install as gem

gem install qc-mailer

Add to Gemfile

gem "qc-mailer"

Include QC::Mailer in your ActionMailer subclass(es) like this:

class MyMailer < ActionMailer::Base
  include QC::Mailer
end

Now, when MyMailer.subject_email(params).deliver is called, an entry will be created in the job queue.

Note that you can still have mail delivered synchronously by using the bang method variant:

MyMailer.subject_email(params).deliver!

If you want to set a different default queue name for your mailer, you can change the default_queue property like so:

# config/initializers/qc_mailer.rb
QC::Mailer.default_queue = 'application_specific_mailer'

Development

To get a working development environment, do the following;

git clone https://github.com/rainforestapp/qc-mailer.git
cd qc-mailer
bundle
createdb queue_classic_test
rake

TODO

  • TBD

Meta

Released under the MIT license.

About

Send email in the background using QueueClassic

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages