##// END OF EJS Templates
Email delivery configuration moved to an unversioned YAML file (config/email.yml, see the sample file) (#1412)....
Email delivery configuration moved to an unversioned YAML file (config/email.yml, see the sample file) (#1412). Email delivery is disabled. It's automatically turned on when configuration is found. git-svn-id: http://redmine.rubyforge.org/svn/trunk@1625 e93f8b46-1217-0410-a6f0-8f06a7374b81

File last commit:

r1611:fc42dd2cef3f
r1611:fc42dd2cef3f
Show More
40-email.rb
17 lines | 534 B | text/x-ruby | RubyLexer
# Loads action_mailer settings from email.yml
# and turns deliveries on if configuration file is found
filename = File.join(File.dirname(__FILE__), '..', 'email.yml')
if File.file?(filename)
mailconfig = YAML::load_file(filename)
if mailconfig.is_a?(Hash) && mailconfig.has_key?(Rails.env)
# Enable deliveries
ActionMailer::Base.perform_deliveries = true
mailconfig[Rails.env].each do |k, v|
v.symbolize_keys! if v.respond_to?(:symbolize_keys!)
ActionMailer::Base.send("#{k}=", v)
end
end
end