Patch #31035

Remove redefinition of ActionMailer::LogSubscriber#deliver which is no longer necessary because of the removal of Setting.bcc_recipients

Added by Go MAEDA over 2 years ago. Updated 2 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:Code cleanup/refactoring
Target version:5.0.0

Description

If the patch #30820 that drops "Blind carbon copy recipients (bcc)" setting is accepted, we can remove the workaround for #12090 that fixes the issue that email recipients are not logged when the setting is enabled, because emails will always be sent using To.

diff --git a/config/initializers/10-patches.rb b/config/initializers/10-patches.rb
index e0559903b..a42b91e4c 100644
--- a/config/initializers/10-patches.rb
+++ b/config/initializers/10-patches.rb
@@ -122,24 +122,6 @@ end

 ActionMailer::Base.add_delivery_method :tmp_file, DeliveryMethods::TmpFile

-# Changes how sent emails are logged
-# Rails doesn't log cc and bcc which is misleading when using bcc only (#12090)
-module ActionMailer
-  class LogSubscriber < ActiveSupport::LogSubscriber
-    def deliver(event)
-      recipients = [:to, :cc, :bcc].inject(+"") do |s, header|
-        r = Array.wrap(event.payload[header])
-        if r.any?
-          s << "\n  #{header}: #{r.join(', ')}" 
-        end
-        s
-      end
-      info("\nSent email \"#{event.payload[:subject]}\" (%1.fms)#{recipients}" % event.duration)
-      debug(event.payload[:mail])
-    end
-  end
-end
-
 module ActionController
   module MimeResponds
     class Collector

Related issues

Related to Redmine - Defect #12090: email recipients not written to action_mailer log if BCC ... Closed
Blocked by Redmine - Patch #30820: Drop setting "Blind carbon copy recipients (bcc)" Closed

Associated revisions

Revision 21197
Added by Go MAEDA 2 months ago

Remove redefinition of ActionMailer::LogSubscriber#deliver which is no longer necessary because of the removal of Setting.bcc_recipients. (#31035).

History

#1 Updated by Go MAEDA over 2 years ago

  • Blocked by Patch #30820: Drop setting "Blind carbon copy recipients (bcc)" added

#2 Updated by Marius BALTEANU 3 months ago

  • Target version changed from Candidate for next major release to 5.0.0

#3 Updated by Go MAEDA 2 months ago

  • Subject changed from Remove the workaround for #12090 to Remove redefinition of ActionMailer::LogSubscriber#deliver which is no longer necessary because of the removal of Setting.bcc_recipients
  • Status changed from New to Closed
  • Assignee set to Go MAEDA

Committed the patch.

#4 Updated by Go MAEDA 2 months ago

  • Related to Defect #12090: email recipients not written to action_mailer log if BCC recipients setting is checked added

Also available in: Atom PDF