Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Configure action_mailer to handle mails asyncronously

* This is a new feature for rails-4, which we should start getting ready
  for.
* Sets up action_mailer to handle mail asyncronously using rails
  queuing.
* No async for tests
  • Loading branch information...
commit 898f6348bc81db7ec148bd10ae89e110cf579627 1 parent 3bed52b
Caleb Thompson authored November 13, 2012

Showing 1 changed file with 8 additions and 0 deletions. Show diff stats Hide diff stats

  1. 8  lib/suspenders/app_builder.rb
8  lib/suspenders/app_builder.rb
@@ -137,6 +137,14 @@ def configure_action_mailer
137 137
       action_mailer_host 'test', 'www.example.com'
138 138
       action_mailer_host 'staging', "staging.#{app_name}.com"
139 139
       action_mailer_host 'production', "#{app_name}.com"
  140
+      inject_into_file('config/application.rb',
  141
+        "\n  config.action_mailer.async = true",
  142
+        before: "\nend"
  143
+      )
  144
+      inject_into_file('config/environments/test.rb',
  145
+        "\n config.action_mailer.async = false",
  146
+        before: "\nend"
  147
+      )
140 148
     end
141 149
 
142 150
     def generate_rspec

0 notes on commit 898f634

Please sign in to comment.
Something went wrong with that request. Please try again.