Module: LogStruct::Integrations::ActionMailer::Callbacks

Extended by:
ActiveSupport::Concern, T::Sig
Defined in:
lib/log_struct/integrations/action_mailer/callbacks.rb

Overview

Backport of the *_deliver callbacks from Rails 7.1

Defined Under Namespace

Modules: ClassMethods, MessageDeliveryCallbacks

Class Method Summary collapse

Class Method Details

.patch_message_deliveryBoolean

Returns:

  • (Boolean)


86
87
88
89
90
91
92
93
94
95
96
# File 'lib/log_struct/integrations/action_mailer/callbacks.rb', line 86

def self.patch_message_delivery
  # Return early if we've already patched
  return true if @patched_message_delivery

  # Prepend our module to add callback support to MessageDelivery
  ::ActionMailer::MessageDelivery.prepend(MessageDeliveryCallbacks)

  # Mark as patched so we don't do it again
  @patched_message_delivery = true
  true
end