Class: Rusen::Notifiers::EmailNotifier

Inherits:
Object
  • Object
show all
Defined in:
lib/rusen/notifiers/email_notifier.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(settings) ⇒ EmailNotifier

Returns a new instance of EmailNotifier.



13
14
15
# File 'lib/rusen/notifiers/email_notifier.rb', line 13

def initialize(settings)
  @settings = settings
end

Class Method Details

.identification_symbolObject



9
10
11
# File 'lib/rusen/notifiers/email_notifier.rb', line 9

def self.identification_symbol
  :email
end

Instance Method Details

#notify(notification) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
# File 'lib/rusen/notifiers/email_notifier.rb', line 17

def notify(notification)
  begin
    @notification = notification

    Pony.mail(email_options.merge({:body => build_body}))

  # We need to ignore all the exceptions thrown by EmailNotifier.notify.
  rescue Exception => e
    ERROR("Rusen: #{e.message} prevented the notification email from being sent.")
  end
end