Class: Findbug::Alerts::Channels::FindbugMailer
- Inherits:
-
ActionMailer::Base
- Object
- ActionMailer::Base
- Findbug::Alerts::Channels::FindbugMailer
- Defined in:
- lib/findbug/alerts/channels/email.rb
Overview
Simple mailer for error alerts
We define this inline because it’s simple and self-contained. Users can override by creating their own FindbugMailer.
Instance Method Summary collapse
Instance Method Details
#error_alert(error_event, recipients) ⇒ Object
47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/findbug/alerts/channels/email.rb', line 47 def error_alert(error_event, recipients) @error = error_event @error_url = build_error_url(error_event) subject = "[#{Rails.env}] #{error_event.exception_class}: #{error_event..to_s.truncate(50)}" mail( to: recipients, subject: subject ) do |format| format.text { render plain: build_text_body(error_event) } format.html { render html: build_html_body(error_event).html_safe } end end |