Browse files

Convert to Markdown, add changelog / history

  • Loading branch information...
1 parent 2fef32d commit a97dc66613bd61fd95c82f394987f1b1a0cd6dca @zapnap zapnap committed Jun 23, 2011
Showing with 44 additions and 31 deletions.
  1. +13 −0 CHANGELOG.md
  2. +31 −31 README.rdoc → README.md
View
13 CHANGELOG.md
@@ -0,0 +1,13 @@
+### 2.0.0
+
+* Removed support for legacy Rails 2.x applications (please use v1.x)
+* Removed mailer proxy, return Mail::Message object
+* Reorganize and modernize gem structure, add bundler and move to RSpec 2.x
+
+### 1.0.1 / 2010-12-21
+
+* Respect ActionMailer::Base.perform_deliveries
+
+### v1.0.0 / 2010-07-28
+
+* Added support for Rails 3.x (Marcin Kulik)
View
62 README.rdoc → README.md
@@ -1,4 +1,4 @@
-= ResqueMailer
+# ResqueMailer
A gem plugin which allows messages prepared by ActionMailer to be delivered
asynchronously. Assumes you're using Resque (http://github.com/defunkt/resque)
@@ -7,25 +7,25 @@ for your background jobs.
Note that recent (2.0+) versions of Resque::Mailer only work with Rails 3.x.
For a version compatible with Rails 2, specify v1.x in your Gemfile.
-== Usage
+## Usage
Include Resque::Mailer in your ActionMailer subclass(es) like this:
- class MyMailer < ActionMailer::Base
- include Resque::Mailer
- end
+ class MyMailer < ActionMailer::Base
+ include Resque::Mailer
+ end
Now, when <tt>MyMailer.subject_email(params).deliver</tt> is called, an entry
will be created in the job queue. Your Resque workers will be able to deliver
this message for you. The queue we're using is imaginatively named +mailer+,
so just make sure your workers know about it and are loading your environment:
- QUEUE=mailer rake environment resque:work
+ QUEUE=mailer rake environment resque:work
Note that you can still have mail delivered synchronously by using the bang
method variant:
- MyMailer.subject_email(params).deliver!
+ MyMailer.subject_email(params).deliver!
Oh, by the way. Don't forget that your async mailer jobs will be processed by
a separate worker. This means that you should resist the temptation to pass
@@ -36,52 +36,52 @@ the id and use it as needed.
If you want to set a different default queue name for your mailer, you can
change the <tt>default_queue_name</tt> property like so:
- # config/initializers/resque_mailer.rb
- Resque::Mailer.default_queue_name = 'application_specific_mailer'
+ # config/initializers/resque_mailer.rb
+ Resque::Mailer.default_queue_name = 'application_specific_mailer'
This is useful when you are running more than one application using
resque_mailer in a shared environment. You will need to use the new queue
name when starting your workers.
- QUEUE=application_specific_mailer rake environment resque:work
+ QUEUE=application_specific_mailer rake environment resque:work
-== Resque::Mailer as a Project Default
+## Resque::Mailer as a Project Default
If you have a variety of mailers in your application and want all of them to use
Resque::Mailer by default, you can subclass ActionMailer::Base and have your
other mailers inherit from an AsyncMailer:
- # config/initializers/resque_mailer.rb
- class AsyncMailer < ActionMailer::Base
- include Resque::Mailer
- end
+ # config/initializers/resque_mailer.rb
+ class AsyncMailer < ActionMailer::Base
+ include Resque::Mailer
+ end
- # app/mailers/example_mailer.rb
- class ExampleMailer < AsyncMailer
- def say_hello(user)
- # ...
- end
- end
+ # app/mailers/example_mailer.rb
+ class ExampleMailer < AsyncMailer
+ def say_hello(user)
+ # ...
+ end
+ end
-== Installation
+## Installation
Install it as a plugin or as a gem plugin from Gemcutter:
- gem install resque_mailer
- script/plugin install git://github.com/zapnap/resque_mailer.git
+ gem install resque_mailer
+ script/plugin install git://github.com/zapnap/resque_mailer.git
- # Rails 3: add it to your Gemfile
- gem 'resque_mailer'
+ # Rails 3: add it to your Gemfile
+ gem 'resque_mailer'
-== Testing
+## Testing
You don't want to be sending actual emails in the test environment, so you can
configure the environments that should be excluded like so:
- # config/initializers/resque_mailer.rb
- Resque::Mailer.excluded_environments = [:test, :cucumber]
+ # config/initializers/resque_mailer.rb
+ Resque::Mailer.excluded_environments = [:test, :cucumber]
-== Note on Patches / Pull Requests
+## Note on Patches / Pull Requests
* Fork the project.
* Make your feature addition or bug fix.
@@ -90,7 +90,7 @@ configure the environments that should be excluded like so:
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
* Send me a pull request. Bonus points for topic branches.
-== Credits
+## Credits
This work was originally inspired by delayed_job_mailer
(http://github.com/andersondias/delayed_job_mailer) by Anderson Dias. Enhanced

0 comments on commit a97dc66

Please sign in to comment.