sendhub 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/sendhub/rails.rb +17 -1
  2. metadata +1 -1
data/lib/sendhub/rails.rb CHANGED
@@ -2,7 +2,19 @@ require 'action_mailer'
2
2
 
3
3
  module SendhubMethods
4
4
  def perform_delivery_sendhub(message)
5
- #Sendhub.send_through_sendhub(message)
5
+ client = Sendhub::Client.new(
6
+ :host => 'localhost:3001',
7
+ :api_key => SENDHUB_API_KEY,
8
+ :secret_key => SENDHUB_SECRET_KEY
9
+ )
10
+ res = client.send_email(
11
+ :from => message.from,
12
+ :to => message.to,
13
+ :subject => message.subject,
14
+ :body => message.body
15
+ )
16
+
17
+ puts res.inspect
6
18
  end
7
19
 
8
20
  def tag(value)
@@ -26,10 +38,14 @@ module SendhubMethods
26
38
  def sendhub_api_key=(value)
27
39
  #Sendhub.api_key = value
28
40
  end
41
+ def sendhub_secret_key=(value)
42
+ #Sendhub.api_key = value
43
+ end
29
44
  end
30
45
 
31
46
  end
32
47
 
33
48
  class ActionMailer::Base
49
+ puts "***** MOOOOO *****"
34
50
  include SendhubMethods
35
51
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sendhub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Taylor