Class: ExceptionAlarm::Mailer

Inherits:
ActionMailer::Base
  • Object
show all
Defined in:
lib/exception_alarm/mailer.rb

Instance Method Summary collapse

Instance Method Details

#alarm(env, exception) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/exception_alarm/mailer.rb', line 13

def alarm(env, exception)
  @env = env
  @exception = exception
  @kontroller = env['action_controller.instance']
  @request = ActionDispatch::Request.new(env)

  mail(
    from: self.class.sender,
    to: self.class.recipients,
    subject: "#{self.class.prefix} (#{@exception.class}) #{@exception.message.inspect}"
  )
end