diff options
author | Mikel Lindsaar <raasdnil@gmail.com> | 2010-01-19 23:09:46 +1100 |
---|---|---|
committer | Mikel Lindsaar <raasdnil@gmail.com> | 2010-01-19 23:09:46 +1100 |
commit | d201d39437c754fa38b14dd4168fab601399918e (patch) | |
tree | b851819d90b78b48a5560bb78f05c63b81ba752c | |
parent | 2107921000f4a186fed36e676d1ac089c8be1f99 (diff) | |
download | rails-d201d39437c754fa38b14dd4168fab601399918e.tar.gz rails-d201d39437c754fa38b14dd4168fab601399918e.tar.bz2 rails-d201d39437c754fa38b14dd4168fab601399918e.zip |
latest updates
-rw-r--r-- | actionmailer/lib/action_mailer/base.rb | 22 | ||||
-rw-r--r-- | actionmailer/test/mail_layout_test.rb | 1 |
2 files changed, 11 insertions, 12 deletions
diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index e0a99fa00c..fd251ff223 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -354,6 +354,8 @@ module ActionMailer #:nodoc: # Alias controller_path to mailer_name so render :partial in views work. alias :controller_path :mailer_name + class_inheritable_accessor :delivery_method + class << self def mailer_name @@ -361,21 +363,17 @@ module ActionMailer #:nodoc: end attr_writer :mailer_name + # Mail uses the same defaults as Rails, except for the file delivery method + # save location so we just add this here. def delivery_settings - @delivery_settings ||= { :file => { :location => defined?(Rails.root) ? "#{Rails.root}/tmp/mails" : "#{Dir.tmpdir}/mails" }, - :smtp => { :address => "localhost", - :port => 25, - :domain => 'localhost.localdomain', - :user_name => nil, - :password => nil, - :authentication => nil, - :enable_starttls_auto => true }, - :sendmail => { :location => '/usr/sbin/sendmail', - :arguments => '-i -t' } - } + @delivery_settings ||= {:file => {:location => defined?(Rails.root) ? "#{Rails.root}/tmp/mails" : "#{Dir.tmpdir}/mails"}} end - attr_writer :delivery_method + # Setup the default settings for Mail delivery + Mail.defaults do + method = ActionMailer::Base.delivery_method ||= :smtp + delivery_method method + end alias :controller_path :mailer_name diff --git a/actionmailer/test/mail_layout_test.rb b/actionmailer/test/mail_layout_test.rb index 0877e7b2cb..b9ff075461 100644 --- a/actionmailer/test/mail_layout_test.rb +++ b/actionmailer/test/mail_layout_test.rb @@ -1,6 +1,7 @@ require 'abstract_unit' class AutoLayoutMailer < ActionMailer::Base + def hello(recipient) recipients recipient subject "You have a mail" |