diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-01-13 13:05:51 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-01-13 13:05:51 +0000 |
commit | 5f5b053ce879f9a01c04cfe0d6c0600b80979dfe (patch) | |
tree | 35e72e91f1d8e11e22bf53c7841ccb58bec96248 /actionmailer/lib/action_mailer | |
parent | d3a8d5f93c6eee44a23f26fcb6573e77625f41b0 (diff) | |
download | rails-5f5b053ce879f9a01c04cfe0d6c0600b80979dfe.tar.gz rails-5f5b053ce879f9a01c04cfe0d6c0600b80979dfe.tar.bz2 rails-5f5b053ce879f9a01c04cfe0d6c0600b80979dfe.zip |
Fixed that bcc and cc should be settable through @bcc and @cc -- not just @headers["Bcc"] and @headers["Cc"] #453 [Eric Hodel]. Fixed Action Mailer to be "warnings safe" so you can run with ruby -w and not get framework warnings #453 [Eric Hodel]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@399 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionmailer/lib/action_mailer')
-rw-r--r-- | actionmailer/lib/action_mailer/base.rb | 16 | ||||
-rwxr-xr-x | actionmailer/lib/action_mailer/vendor/tmail.rb | 1 |
2 files changed, 9 insertions, 8 deletions
diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index 25dc6b2654..8390e70f4a 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -86,6 +86,7 @@ module ActionMailer #:nodoc: attr_accessor :recipients, :subject, :body, :from, :sent_on, :headers, :bcc, :cc def initialize + @bcc = @cc = @from = @recipients = @sent_on = @subject = @body = nil @headers = {} end @@ -147,15 +148,16 @@ module ActionMailer #:nodoc: mailer.body = {} mailer.send(method_name, *parameters) - if String === mailer.body - mail = create(mailer.recipients, mailer.subject, mailer.body, mailer.from, mailer.sent_on, mailer.headers) - else - mail = create(mailer.recipients, mailer.subject, render_body(mailer, method_name), mailer.from, mailer.sent_on, mailer.headers) + unless String === mailer.body then + mailer.body = render_body mailer, method_name end - mail.bcc = @bcc if @bcc - mail.cc = @cc if @cc - + mail = create(mailer.recipients, mailer.subject, mailer.body, + mailer.from, mailer.sent_on, mailer.headers) + + mail.bcc = mailer.bcc unless mailer.bcc.nil? + mail.cc = mailer.cc unless mailer.cc.nil? + return mail end diff --git a/actionmailer/lib/action_mailer/vendor/tmail.rb b/actionmailer/lib/action_mailer/vendor/tmail.rb index 013f3020c2..8cea88d3ed 100755 --- a/actionmailer/lib/action_mailer/vendor/tmail.rb +++ b/actionmailer/lib/action_mailer/vendor/tmail.rb @@ -1,4 +1,3 @@ require 'tmail/info' require 'tmail/mail' require 'tmail/mailbox' -require 'tmail/obsolete' |