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

#config, #initialize, #pop_context, #push_context

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



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

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

#receive(event) ⇒ Object



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

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