Class: Blazer::CheckMailer

Inherits:
ActionMailer::Base
  • Object
show all
Includes:
ActionView::Helpers::TextHelper
Defined in:
lib/blazer/check_mailer.rb

Instance Method Summary collapse

Instance Method Details

#failing_checks(email, checks) ⇒ Object



21
22
23
24
25
# File 'lib/blazer/check_mailer.rb', line 21

def failing_checks(email, checks)
  @checks = checks
  # add reply_to for mailing lists
  mail to: email, reply_to: email, subject: "#{pluralize(checks.size, "Check")} Failing"
end

#state_change(check, state, state_was, rows_count, error, columns, rows, column_types, check_type) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/blazer/check_mailer.rb', line 8

def state_change(check, state, state_was, rows_count, error, columns, rows, column_types, check_type)
  @check = check
  @state = state
  @state_was = state_was
  @rows_count = rows_count
  @error = error
  @columns = columns
  @rows = rows
  @column_types = column_types
  @check_type = check_type
  mail to: check.emails, reply_to: check.emails, subject: "Check #{state.titleize}: #{check.query.name}"
end