Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updating the documentation to ActionMailer::Base.queue

  • Loading branch information...
commit a25b5f683d6d7c1a9678227c2e067bcf3882bc2c 1 parent d0c25f2
@rafaelfranca rafaelfranca authored
View
3  actionmailer/lib/action_mailer/base.rb
@@ -363,6 +363,9 @@ module ActionMailer #:nodoc:
# * <tt>deliveries</tt> - Keeps an array of all the emails sent out through the Action Mailer with
# <tt>delivery_method :test</tt>. Most useful for unit and functional testing.
#
+ # * <tt>queue</> - The queue that will be used to deliver the mail. The queue should expect a job that
+ # responds to <tt>run</tt>
@frodsan
frodsan added a note

punctuation ..

@rafaelfranca Owner

When you update some docs, please change this one too

@frodsan
frodsan added a note

Ok, no problem :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ #
@frodsan
frodsan added a note

:scissors: empty line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
class Base < AbstractController::Base
include DeliveryMethods
abstract!
12 guides/source/action_mailer_basics.textile
@@ -538,14 +538,18 @@ Rails provides a Synchronous Queue by default. If you want to use an Asynchronou
h4. Custom Queues
-If you need a different queue than <tt>Rails.queue</tt> for your mailer you can override <tt>ActionMailer::Base#queue</tt>:
+If you need a different queue than <tt>Rails.queue</tt> for your mailer you can use <tt>ActionMailer::Base.queue=</tt>:
<ruby>
class WelcomeMailer < ActionMailer::Base
- def queue
- MyQueue.new
- end
+ self.queue = MyQueue.new
end
</ruby>
+or adding to your <tt>config/environments/$RAILS_ENV.rb</tt>:
+
+<ruby>
+config.action_mailer.queue = MyQueue.new
+</ruby>
+
Your custom queue should expect a job that responds to <tt>#run</tt>.
View
5 guides/source/configuring.textile
@@ -434,6 +434,11 @@ config.action_mailer.observers = ["MailObserver"]
config.action_mailer.interceptors = ["MailInterceptor"]
</ruby>
+* +config.action_mailer.queue+ registers the queue that will be used to deliver the mail.
+<ruby>
+config.action_mailer.queue = SomeQueue.new
+</ruby>
+
h4. Configuring Active Support
There are a few configuration options available in Active Support:
Please sign in to comment.
Something went wrong with that request. Please try again.