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.
- data/lib/sendhub/rails.rb +17 -1
- 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
|
-
|
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
|