class SendCloud::DeliveryClass

Attributes

settings[RW]

Public Class Methods

new(settings) click to toggle source
# File lib/send-cloud.rb, line 27
def initialize (settings)
  SendCloud.api_user = settings[:api_user]
  SendCloud.api_key = settings[:api_key]
end

Public Instance Methods

deliver!(mail) click to toggle source
# File lib/send-cloud.rb, line 32
def deliver! (mail)
  begin
    SendCloud::Mail.send({
      from: mail.from_addrs.first,
      to: mail.destinations.join(';'),
      subject: mail.subject,
      html: mail.body.encoded,
      fromname: mail[:fromname].to_s
    })
  rescue => e
    raise e
  end
end