Class: UiChanged::NotificationsMailer

Inherits:
ActionMailer::Base
  • Object
show all
Includes:
Resque::Mailer
Defined in:
app/mailers/ui_changed/notifications_mailer.rb

Instance Method Summary collapse

Instance Method Details

#new_compares_messageObject



30
31
32
33
34
35
36
37
38
39
# File 'app/mailers/ui_changed/notifications_mailer.rb', line 30

def new_compares_message
  if !UiChanged::ConfigHelper.email_after_compare
    puts '----------- NOT sending email after compare -------------'
    return
  end
  count = UiChanged::Screenshot.where(:is_compare => true).count

  puts '----------- sending email message after compare -------------'
  mail(:subject => "Ui_Changed - saved #{count} compare screenshots", :body => "Click here to view them: http://localhost:3000/ui_changed/screenshots/compares")
end

#new_controls_messageObject



8
9
10
11
12
13
14
15
16
17
# File 'app/mailers/ui_changed/notifications_mailer.rb', line 8

def new_controls_message
  if !UiChanged::ConfigHelper.email_after_control_crawl
    puts '----------- NOT sending email after control crawl -------------'
    return
  end
  count = UiChanged::Screenshot.where(:is_control => true).count

  puts '----------- sending email message after control crawl -------------'
  mail(:subject => "Ui_Changed - saved #{count} control screenshots", :body => "Click here to view them: http://localhost:3000/ui_changed/screenshots/controls")
end

#new_diffs_messageObject



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'app/mailers/ui_changed/notifications_mailer.rb', line 41

def new_diffs_message
  if !UiChanged::ConfigHelper.email_after_compare_with_diffs
    puts '----------- NOT sending email after compare with diffs -------------'
    return
  end
  count = UiChanged::Screenshot.where(:diff_found => true).count

  if !UiChanged::ConfigHelper.email_after_compare_with_diffs_on_zero_found && count == 0
    puts '----------- NOT sending email message after compare with diffs b/c zero [diffs] found -------------'
    return
  end

  puts '----------- sending email message after compare with diffs -------------'
  mail(:subject => "Ui_Changed - found #{count} diffs", :body => "Click here to view them: http://localhost:3000/ui_changed/screenshots/diffs")
end

#new_tests_messageObject



19
20
21
22
23
24
25
26
27
28
# File 'app/mailers/ui_changed/notifications_mailer.rb', line 19

def new_tests_message
  if !UiChanged::ConfigHelper.email_after_test_crawl
    puts '----------- NOT sending email after test crawl -------------'
    return
  end
  count = UiChanged::Screenshot.where(:is_test => true).count

  puts '----------- sending email message after test crawl -------------'
  mail(:subject => "Ui_Changed - saved #{count} test screenshots", :body => "Click here to view them: http://localhost:3000/ui_changed/screenshots/tests")
end