Class: Sendhub::Rails

Inherits:
Object
  • Object
show all
Defined in:
lib/sendhub/rails3.rb

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Rails

Returns a new instance of Rails.



3
4
5
6
7
8
# File 'lib/sendhub/rails3.rb', line 3

def initialize(options)
  @client = Sendhub::Client.new(
    :api_key => options[:api_key],
    :secret_key => options[:secret_key]
  )
end

Instance Method Details

#deliver!(message) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/sendhub/rails3.rb', line 10

def deliver!(message)
  res = @client.send_email(
    :from => message.from,
    :to => message.to,
    :subject => message.subject,
    :body => message.body,
    :content_type => message.content_type
  )
end