Class: MaileroobyDeliveryMethod
- Inherits:
-
Object
- Object
- MaileroobyDeliveryMethod
- Defined in:
- lib/mailerooby/mailerooby_delivery_method.rb
Instance Attribute Summary collapse
-
#settings ⇒ Object
Returns the value of attribute settings.
Instance Method Summary collapse
- #deliver!(mail) ⇒ Object
-
#initialize(values) ⇒ MaileroobyDeliveryMethod
constructor
A new instance of MaileroobyDeliveryMethod.
Constructor Details
#initialize(values) ⇒ MaileroobyDeliveryMethod
Returns a new instance of MaileroobyDeliveryMethod.
4 5 6 |
# File 'lib/mailerooby/mailerooby_delivery_method.rb', line 4 def initialize(values) self.settings = values end |
Instance Attribute Details
#settings ⇒ Object
Returns the value of attribute settings.
8 9 10 |
# File 'lib/mailerooby/mailerooby_delivery_method.rb', line 8 def settings @settings end |
Instance Method Details
#deliver!(mail) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/mailerooby/mailerooby_delivery_method.rb', line 10 def deliver!(mail) from = mail.from.join(', ') to = mail.to.join(', ') subject = mail.subject body = mail.body.raw_source cc = mail.cc.join(', ') if mail.cc.present? bcc = mail.bcc.join(', ') if mail.bcc.present? reply_to = mail.reply_to if mail.reply_to.present? = (mail) # Send the email via Maileroob API response = Mailerooby::EmailSender.send_email(from: from, to: to, subject: subject, body: body, cc: cc, bcc: bcc, reply_to: reply_to, attachments: ) # Check the response and raise an error if necessary handle_response(response) end |