# 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.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