From 5f5b053ce879f9a01c04cfe0d6c0600b80979dfe Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Thu, 13 Jan 2005 13:05:51 +0000 Subject: 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 --- actionmailer/lib/action_mailer/base.rb | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'actionmailer/lib/action_mailer/base.rb') 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 -- cgit v1.2.3