Class: Tartarus::Notifiers::Mail

Inherits:
ActionMailer::Base
  • Object
show all
Defined in:
lib/tartarus/notifiers/mail.rb

Instance Method Summary collapse

Instance Method Details

#notification(address, exception) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/tartarus/notifiers/mail.rb', line 3

def notification(address, exception)
  subject = "#{Tartarus.configuration['notification_prefix']}Exception raised at #{exception.controller_path}##{exception.action_name} (#{exception.exception_class}) #{exception.message}" 
  mail(:to => address, :from => Tartarus.configuration['notification_sender'], :subject => subject) do |format|
    format.text do 
      render :text => %{
        A new exception was raised (#{exception.created_at.strftime("%m/%d/%Y %I:%M%p")}):

        Class    : #{exception.exception_class}
        Location : #{exception.controller_path}##{exception.action_name} 
        Message  : #{exception.message}
        Count    : #{exception.group_count}

        Backtrace: 
        #{exception.backtrace}

        Request: 
        #{exception.request}
      }
    end
  end
end