Sha256: 3a7ca64a9f9478c041e62aabce86ef9ac5480a33193539cf70640d7fc8ab3daa

Contents?: true

Size: 516 Bytes

Versions: 1

Compression:

Stored size: 516 Bytes

Contents

module ExceptionAlarm
  class Notifier < ActionMailer::Base
    cattr_accessor :prefix
    cattr_accessor :sender
    cattr_accessor :recipients
    self.prefix = '[ERROR]'
    self.sender = 'exception@example.com'
    self.recipients = []

    def alarm(env, exception)
      @env = env
      @exception = exception

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
exception-alarm-0.1.0 lib/exception_alarm/notifier.rb