Skip to content

Commit

Permalink
Only load mailer.yml config settings if it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
jpallen committed Feb 4, 2012
1 parent fc9398e commit c2ff553
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions config/environments/production.rb
Expand Up @@ -26,7 +26,9 @@
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = true
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = HashWithIndifferentAccess.new(
YAML::load(ERB.new(File.read(File.join(RAILS_ROOT, 'config/mailer.yml'))).result)['production']
)
if File.exist?(File.join(RAILS_ROOT, 'config/mailer.yml'))
config.action_mailer.smtp_settings = HashWithIndifferentAccess.new(
YAML::load(ERB.new(File.read(File.join(RAILS_ROOT, 'config/mailer.yml'))).result)['production']
)
end

0 comments on commit c2ff553

Please sign in to comment.