annotate config/initializers/.svn/text-base/40-email.rb.svn-base @ 107:361f1e8b2e23 luisf

Feature #1: Fixed the collection_select variable issue User edit view: removed wiki toolbar and description from the description text area in the user; User edit view: added institutions collection select; User show view: institution name now visible. Users_controller: fixed a bug retrieving the institution name
author luisf
date Fri, 17 Dec 2010 11:18:51 +0000
parents 513646585e45
children
rev   line source
Chris@0 1 # Loads action_mailer settings from email.yml
Chris@0 2 # and turns deliveries on if configuration file is found
Chris@0 3
Chris@0 4 filename = File.join(File.dirname(__FILE__), '..', 'email.yml')
Chris@0 5 if File.file?(filename)
Chris@0 6 mailconfig = YAML::load_file(filename)
Chris@0 7
Chris@0 8 if mailconfig.is_a?(Hash) && mailconfig.has_key?(Rails.env)
Chris@0 9 # Enable deliveries
Chris@0 10 ActionMailer::Base.perform_deliveries = true
Chris@0 11
Chris@0 12 mailconfig[Rails.env].each do |k, v|
Chris@0 13 v.symbolize_keys! if v.respond_to?(:symbolize_keys!)
Chris@0 14 ActionMailer::Base.send("#{k}=", v)
Chris@0 15 end
Chris@0 16 end
Chris@0 17 end