Class: Notifun::Notifier::EmailNotifier

Inherits:
ParentNotifier show all
Defined in:
lib/notifun/notifiers/email_notifier.rb

Instance Attribute Summary

Attributes inherited from ParentNotifier

#error_message, #success

Instance Method Summary collapse

Methods inherited from ParentNotifier

#initialize

Constructor Details

This class inherits a constructor from Notifun::Notifier::ParentNotifier

Instance Method Details

#notify!(email, subject, html, text, message_template, options) ⇒ Object



2
3
4
5
6
7
8
9
10
# File 'lib/notifun/notifiers/email_notifier.rb', line 2

def notify!(email, subject, html, text, message_template, options)
  begin
    Notifun::MessageMailer.send_message(email, subject, html, text, message_template, options).deliver_now
    @success = true
  rescue Net::SMTPSyntaxError => e
    @error_message = e.message
    @success = false
  end
end