Class: Georgia::Notifier

Inherits:
ActionMailer::Base
  • Object
show all
Includes:
SendGrid
Defined in:
app/mailers/georgia/notifier.rb

Instance Method Summary collapse

Instance Method Details

#notify_admins(message, url) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
# File 'app/mailers/georgia/notifier.rb', line 6

def notify_admins(message, url)
  @message = message
  @url = url
  emails_to = Georgia::User.admins.map(&:email)
  unless emails_to.empty?
    mail(
      from: "[email protected]",
      to: emails_to,
      subject: @message
      )
  end
end

#notify_editors(message, url) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
# File 'app/mailers/georgia/notifier.rb', line 19

def notify_editors(message, url)
  @message = message
  @url = url
  emails_to = Georgia::User.editors.map(&:email)
  unless emails_to.empty?
    mail(
      from: "[email protected]",
      to: emails_to,
      subject: @message
      )
  end
end