check_mailer.rb 675 B

12345678910111213141516171819202122
  1. module Blazer
  2. class CheckMailer < ActionMailer::Base
  3. include ActionView::Helpers::TextHelper
  4. default from: Blazer.from_email if Blazer.from_email
  5. def state_change(check, state, state_was, rows_count, error)
  6. @check = check
  7. @state = state
  8. @state_was = state_was
  9. @rows_count = rows_count
  10. @error = error
  11. mail to: check.emails, reply_to: check.emails, subject: "Check #{state.titleize}: #{check.query.name}"
  12. end
  13. def failing_checks(email, checks)
  14. @checks = checks
  15. # add reply_to for mailing lists
  16. mail to: email, reply_to: email, subject: "#{pluralize(checks.size, "Check")} Failing"
  17. end
  18. end
  19. end