Class: SnowmanIO::SnowMailer

Inherits:
ActionMailer::Base
  • Object
show all
Defined in:
lib/snowman-io/snow_mailer.rb

Instance Method Summary collapse

Instance Method Details

#check_triggered(check, at, base_url, to, danger) ⇒ Object



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/snowman-io/snow_mailer.rb', line 48

def check_triggered(check, at, base_url, to, danger)
  @check = check
  @at = at
  @base_url = base_url
  @danger = danger
  mail(
    to: to,
    subject: "SnowmanIO: failed check at #{at.strftime("%Y-%m-%d %H:%M:%S")}"
  ) do |format|
    format.html { 
      Premailer.new(render(:"snow_mailer/check_triggered", layout: "main"), {
        css: [
          File.expand_path('../views/layouts/styles.css', __FILE__),
          File.expand_path('../views/layouts/custom.css', __FILE__)
        ],
        with_html_string: true
      }).to_inline_css
    }
  end
end

#restore_password(user, base_url) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/snowman-io/snow_mailer.rb', line 10

def restore_password(user, base_url)
  @url = base_url + "/restore_password/" + user.restore_pass_token
  @user = user
  mail(
    to: user.email,
    subject: "SnowmanIO: password restore"
  ) do |format|
    format.html { 
      Premailer.new(render(:"snow_mailer/restore_password", layout: "main"), {
        css: [
          File.expand_path('../views/layouts/styles.css', __FILE__),
          File.expand_path('../views/layouts/custom.css', __FILE__)
        ],
        with_html_string: true
      }).to_inline_css
    }
  end
end

#send_invite(user, base_url, by) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/snowman-io/snow_mailer.rb', line 29

def send_invite(user, base_url, by)
  @url = base_url + "/invite/" + user.invite_token
  @by = by
  mail(
    to: user.email,
    subject: "SnowmanIO: invite"
  ) do |format|
    format.html { 
      Premailer.new(render(:"snow_mailer/send_invite", layout: "main"), {
        css: [
          File.expand_path('../views/layouts/styles.css', __FILE__),
          File.expand_path('../views/layouts/custom.css', __FILE__)
        ],
        with_html_string: true
      }).to_inline_css
    }
  end
end