# 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 = attributes_from_notification(event) payload = event.payload case name when "deliver" base.tap do |o| o[:message_id] = payload[:message_id] o[:mailer] = payload[:mailer] o[:perform_deliveries] = payload[:perform_deliveries] end when "process" base.tap do |o| o[:mailer] = payload[:mailer] o[:action] = payload[:action] end else nil end end end end end