Class: Epilog::Rails::ActionMailerSubscriber

Inherits:
LogSubscriber
  • Object
show all
Defined in:
lib/epilog/rails/action_mailer_subscriber.rb

Instance Attribute Summary

Attributes inherited from LogSubscriber

#logger

Instance Method Summary collapse

Methods inherited from LogSubscriber

#initialize

Constructor Details

This class inherits a constructor from Epilog::Rails::LogSubscriber

Instance Method Details

#deliver(event) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/epilog/rails/action_mailer_subscriber.rb', line 6

def deliver(event)
  info do
    hash(
      event,
      message: 'Sent mail',
      recipients: Array(event.payload[:to])
    )
  end
end

#process(event) ⇒ Object



25
26
27
28
29
30
31
32
33
34
# File 'lib/epilog/rails/action_mailer_subscriber.rb', line 25

def process(event)
  debug do
    hash(
      event,
      message: 'Processed outbound mail',
      mailer: event.payload[:mailer],
      action: event.payload[:action]
    )
  end
end

#receive(event) ⇒ Object



16
17
18
19
20
21
22
23
# File 'lib/epilog/rails/action_mailer_subscriber.rb', line 16

def receive(event)
  info do
    hash(
      event,
      message: 'Received mail'
    )
  end
end