123456789_123456789_123456789_123456789_123456789_

Class: ActionMailer::StructuredEventSubscriber

Do not use. This class is for internal use only.

Constant Summary

::ActiveSupport::StructuredEventSubscriber - Inherited

DEBUG_CHECK

Class Attribute Summary

Class Method Summary

Instance Attribute Summary

Instance Method Summary

::ActiveSupport::StructuredEventSubscriber - Inherited

#call,
#emit_debug_event

Like emit_event, but only emits when the event reporter is in debug mode.

#emit_event

Emit a structured event via Rails.event.notify.

#silenced?, #handle_event_error

::ActiveSupport::Subscriber - Inherited

Constructor Details

This class inherits a constructor from ActiveSupport::StructuredEventSubscriber

Instance Method Details

#deliver(event)

An email was delivered.

[ GitHub ]

  
# File 'actionmailer/lib/action_mailer/structured_event_subscriber.rb', line 8

def deliver(event)
  exception = event.payload[:exception_object]
  payload = {
    message_id: event.payload[:message_id],
    duration: event.duration.round(2),
    mail: event.payload[:mail],
    perform_deliveries: event.payload[:perform_deliveries],
  }

  if exception
    payload[:exception_class] = exception.class.name
    payload[:exception_message] = exception.message
  end

  emit_debug_event("action_mailer.delivered", payload)
end

#process(event)

An email was generated.

[ GitHub ]

  
# File 'actionmailer/lib/action_mailer/structured_event_subscriber.rb', line 27

def process(event)
  emit_debug_event("action_mailer.processed",
    mailer: event.payload[:mailer],
    action: event.payload[:action],
    duration: event.duration.round(2),
  )
end