Class: MultiNotifier::Adapters::Mail
- Inherits:
-
MultiNotifier::Adapter
- Object
- MultiNotifier::Adapter
- MultiNotifier::Adapters::Mail
- Defined in:
- lib/multi_notifier/adapters/mail.rb
Defined Under Namespace
Classes: DeliveryValidator, Mailer
Instance Attribute Summary collapse
-
#delivery ⇒ Object
Returns the value of attribute delivery.
-
#from ⇒ Object
Returns the value of attribute from.
-
#html_body ⇒ Object
Returns the value of attribute html_body.
-
#subject ⇒ Object
Returns the value of attribute subject.
-
#text_body ⇒ Object
Returns the value of attribute text_body.
-
#to ⇒ Object
Returns the value of attribute to.
Instance Method Summary collapse
Methods inherited from MultiNotifier::Adapter
Methods included from MultiNotifier::Adapter::ActiveModel::Model
included, #initialize, #persisted?
Instance Attribute Details
#delivery ⇒ Object
Returns the value of attribute delivery.
15 16 17 |
# File 'lib/multi_notifier/adapters/mail.rb', line 15 def delivery @delivery end |
#from ⇒ Object
Returns the value of attribute from.
15 16 17 |
# File 'lib/multi_notifier/adapters/mail.rb', line 15 def from @from end |
#html_body ⇒ Object
Returns the value of attribute html_body.
15 16 17 |
# File 'lib/multi_notifier/adapters/mail.rb', line 15 def html_body @html_body end |
#subject ⇒ Object
Returns the value of attribute subject.
15 16 17 |
# File 'lib/multi_notifier/adapters/mail.rb', line 15 def subject @subject end |
#text_body ⇒ Object
Returns the value of attribute text_body.
15 16 17 |
# File 'lib/multi_notifier/adapters/mail.rb', line 15 def text_body @text_body end |
#to ⇒ Object
Returns the value of attribute to.
15 16 17 |
# File 'lib/multi_notifier/adapters/mail.rb', line 15 def to @to end |
Instance Method Details
#notify ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/multi_notifier/adapters/mail.rb', line 29 def notify Mailer.delivery_method = delivery[:method] Mailer.send("#{delivery[:method]}_settings=", delivery[:settings] || {}) headers = { :from => from, :to => to, :subject => subject } mailer = Mailer.notificaiton(headers, text_body, html_body) mailer.deliver mailer end |