Sha256: 1214e728e2e46446a020d8885d3cd021ff0b2ab1bf27454a77a96d5b2f13a6ca

Contents?: true

Size: 783 Bytes

Versions: 1

Compression:

Stored size: 783 Bytes

Contents

# frozen_string_literal: true

module PlainApm
  module Hooks
    class ActionMailer < ActiveSupportSubscriber
      NOTIFICATION_PATTERN = /\A[^!]\w+\.action_mailer\Z/.freeze

      private

      def notification_pattern
        NOTIFICATION_PATTERN
      end

      def payload(event)
        name, base = common_attributes(event)
        payload = event.payload

        case name
        when "deliver"
          base.merge({
            "message_id" => payload[:message_id],
            "mailer" => payload[:mailer],
            "perform_deliveries" => payload[:perform_deliveries]
          })
        when "process"
          base.merge({
            "mailer" => payload[:mailer],
            "action" => payload[:action]
          })
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
plain_apm-0.6.7 lib/plain_apm/hooks/action_mailer.rb