lib/exception_alarm/mailer.rb in exception-alarm-1.0.1 vs lib/exception_alarm/mailer.rb in exception-alarm-1.0.2
- old
+ new
@@ -11,13 +11,17 @@
@env = env
@exception = exception
@kontroller = env['action_controller.instance']
@request = ActionDispatch::Request.new(env)
+ attachments["exception_#{@request.host.gsub(".", "_")}_#{Time.now.to_i}.txt"] = render(:alarm)
mail(
from: self.class.sender,
to: self.class.recipients,
- subject: "#{self.class.prefix} (#{@exception.class}) #{@exception.message.inspect}"
+ subject: "#{self.class.prefix} (#{@exception.class}) #{@exception.message.inspect}",
+ body:
+ "A #{@exception.class} occurred in #{@kontroller.controller_name}##{@kontroller.action_name}:\n" +
+ @exception.backtrace.first.to_s
)
end
end
end