Sha256: 2af383c7016de23b0b06736a64a75387c02aa24abd66cf262fec5dcf2b6a26d9

Contents?: true

Size: 1.61 KB

Versions: 26

Compression:

Stored size: 1.61 KB

Contents

# Application template recipe for the rails_apps_composer. Check for a newer version here:
# https://github.com/RailsApps/rails_apps_composer/blob/master/recipes/action_mailer.rb

after_bundler do
  say_wizard "ActionMailer recipe running 'after bundler'"
  # modifying environment configuration files for ActionMailer
  gsub_file 'config/environments/development.rb', /# Don't care if the mailer can't send/, '# ActionMailer Config'
  gsub_file 'config/environments/development.rb', /config.action_mailer.raise_delivery_errors = false/ do
  <<-RUBY
config.action_mailer.default_url_options = { :host => 'localhost:3000' }
  # A dummy setup for development - no deliveries, but logged
  config.action_mailer.delivery_method = :smtp
  config.action_mailer.perform_deliveries = false
  config.action_mailer.raise_delivery_errors = true
  config.action_mailer.default :charset => "utf-8"
RUBY
  end
  gsub_file 'config/environments/production.rb', /config.active_support.deprecation = :notify/ do
  <<-RUBY
config.active_support.deprecation = :notify

  config.action_mailer.default_url_options = { :host => 'yourhost.com' }
  # ActionMailer Config
  # Setup for production - deliveries, no errors raised
  config.action_mailer.delivery_method = :smtp
  config.action_mailer.perform_deliveries = true
  config.action_mailer.raise_delivery_errors = false
  config.action_mailer.default :charset => "utf-8"
RUBY
  end
  
end
  
__END__

name: ActionMailer
description: "Configure ActionMailer to show errors during development and suppress failures when the app is deployed to production."
author: RailsApps

category: other
tags: [utilities, configuration]

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
rails_apps_composer-1.1.4 recipes/action_mailer.rb
rails_apps_composer-1.1.3 recipes/action_mailer.rb
rails_apps_composer-1.1.2 recipes/action_mailer.rb
rails_apps_composer-1.1.1 recipes/action_mailer.rb
rails_apps_composer-1.1.0 recipes/action_mailer.rb
rails_apps_composer-1.0.26 recipes/action_mailer.rb
rails_apps_composer-1.0.25 recipes/action_mailer.rb
rails_apps_composer-1.0.24 recipes/action_mailer.rb
rails_apps_composer-1.0.23 recipes/action_mailer.rb
rails_apps_composer-1.0.22 recipes/action_mailer.rb
rails_apps_composer-1.0.21 recipes/action_mailer.rb
rails_apps_composer-1.0.20 recipes/action_mailer.rb
rails_apps_composer-1.0.19 recipes/action_mailer.rb
rails_apps_composer-1.0.18 recipes/action_mailer.rb
rails_apps_composer-1.0.17 recipes/action_mailer.rb
rails_apps_composer-1.0.16 recipes/action_mailer.rb
rails_apps_composer-1.0.15 recipes/action_mailer.rb
rails_apps_composer-1.0.14 recipes/action_mailer.rb
rails_apps_composer-1.0.12 recipes/action_mailer.rb
rails_apps_composer-1.0.11 recipes/action_mailer.rb