Class: AdminMailer

Inherits:
ActionMailer::Base
  • Object
show all
Defined in:
app/mailers/admin_mailer.rb

Instance Method Summary collapse

Instance Method Details

#error_report(error_report, from, description) ⇒ Object


4
5
6
7
8
9
10
11
12
13
14
# File 'app/mailers/admin_mailer.rb', line 4

def error_report(error_report, from, description)
  @error_report = error_report
  @from = from
  @description = description
  short_message = @error_report[:message].gsub(/[\s\n]+/, " ")[0..80]
  mail(
    to:      "[email protected]",
    from:    "\"Error reports\" <[email protected]>",
    subject: "[#{PagesCore.config(:site_name)}] Error: #{short_message}"
  )
end

#invite(invite, url) ⇒ Object


25
26
27
28
29
30
31
32
# File 'app/mailers/admin_mailer.rb', line 25

def invite(invite, url)
  @invite = invite
  @url = url
  mail(
    to:      @invite.email,
    subject: "#{PagesCore.config(:site_name)} has invited you to Pages"
  )
end

#password_reset(user, url) ⇒ Object


16
17
18
19
20
21
22
23
# File 'app/mailers/admin_mailer.rb', line 16

def password_reset(user, url)
  @user = user
  @url = url
  mail(
    to: @user.email,
    subject: "Reset your password on #{PagesCore.config(:site_name)}"
  )
end