Class: MultiMail::Sender::Postmark
- Inherits:
-
Object
- Object
- MultiMail::Sender::Postmark
- Includes:
- Base
- Defined in:
- lib/multi_mail/postmark/sender.rb
Overview
Postmark's outgoing mail sender.
Instance Attribute Summary
Attributes included from Base
Instance Method Summary collapse
-
#deliver!(mail) ⇒ Object
Delivers a message via the Postmark API.
Methods included from Base
Instance Method Details
#deliver!(mail) ⇒ Object
Delivers a message via the Postmark API.
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/multi_mail/postmark/sender.rb', line 20 def deliver!(mail) mail.delivery_method Mail::Postmark, settings if settings[:return_response] mail.deliver! else mail.deliver end rescue ::Postmark::InvalidApiKeyError => e raise InvalidAPIKey, e. rescue ::Postmark::InvalidMessageError => e case e. when "Invalid 'From' value." raise MissingSender, e. when 'Zero recipients specified' raise MissingRecipients, e. when 'Provide either email TextBody or HtmlBody or both.' raise MissingBody, e. else raise InvalidMessage, e. end end |