aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer
diff options
context:
space:
mode:
Diffstat (limited to 'actionmailer')
-rw-r--r--actionmailer/CHANGELOG2
-rw-r--r--actionmailer/lib/action_mailer/base.rb5
-rwxr-xr-xactionmailer/test/mail_service_test.rb3
3 files changed, 8 insertions, 2 deletions
diff --git a/actionmailer/CHANGELOG b/actionmailer/CHANGELOG
index 852371ec12..89ddcc5ad7 100644
--- a/actionmailer/CHANGELOG
+++ b/actionmailer/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Less verbose mail logging: just recipients for :info log level; the whole email for :debug only. #8000 [iaddict, Tarmo Tänav]
+
* Updated TMail to version 1.2.1 [raasdnil]
* Fixed that you don't have to call super in ActionMailer::TestCase#setup #10406 [jamesgolick]
diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb
index 2da3679206..ab3ca7f1be 100644
--- a/actionmailer/lib/action_mailer/base.rb
+++ b/actionmailer/lib/action_mailer/base.rb
@@ -468,7 +468,10 @@ module ActionMailer #:nodoc:
# no alternate has been given as the parameter, this will fail.
def deliver!(mail = @mail)
raise "no mail object available for delivery!" unless mail
- logger.info "Sent mail:\n #{mail.encoded}" unless logger.nil?
+ unless logger.nil?
+ logger.info "Sent mail to #{recipients.to_a.join(', ')}"
+ logger.debug "\n#{mail.encoded}"
+ end
begin
__send__("perform_delivery_#{delivery_method}", mail) if perform_deliveries
diff --git a/actionmailer/test/mail_service_test.rb b/actionmailer/test/mail_service_test.rb
index 73a6f0f6d5..91161e9ddb 100755
--- a/actionmailer/test/mail_service_test.rb
+++ b/actionmailer/test/mail_service_test.rb
@@ -534,7 +534,8 @@ class ActionMailerTest < Test::Unit::TestCase
def test_delivery_logs_sent_mail
mail = TestMailer.create_signed_up(@recipient)
logger = mock()
- logger.expects(:info).with("Sent mail:\n #{mail.encoded}")
+ logger.expects(:info).with("Sent mail to #{@recipient}")
+ logger.expects(:debug).with("\n#{mail.encoded}")
TestMailer.logger = logger
TestMailer.deliver_signed_up(@recipient)
end