Class: Venn::Services::Mandrill

Inherits:
Object
  • Object
show all
Defined in:
lib/venn/services/mandrill.rb

Instance Method Summary collapse

Constructor Details

#initialize(keys) ⇒ Mandrill

Returns a new instance of Mandrill.



5
6
7
8
# File 'lib/venn/services/mandrill.rb', line 5

def initialize(keys)
  @name = 'mandrill'
  @client = ::Mandrill::API.new keys[:api_key]
end

Instance Method Details

#send(from, to, subject, message) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/venn/services/mandrill.rb', line 10

def send(from, to, subject, message)
  message = {
    'subject' => subject,
    'to' => [{ 'email' => to}],
    'from_email' => from,
    'html' => message
  }
  @client.messages.send message

  return @name
end