diff options
Diffstat (limited to 'guides/source')
-rw-r--r-- | guides/source/action_mailer_basics.textile | 12 | ||||
-rw-r--r-- | guides/source/configuring.textile | 5 |
2 files changed, 13 insertions, 4 deletions
diff --git a/guides/source/action_mailer_basics.textile b/guides/source/action_mailer_basics.textile index 6d04a76088..d92d5c48fb 100644 --- a/guides/source/action_mailer_basics.textile +++ b/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>. diff --git a/guides/source/configuring.textile b/guides/source/configuring.textile index dd84754b22..73d6102eac 100644 --- a/guides/source/configuring.textile +++ b/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: |