exactly 0.0.2 → 0.0.3
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/exactly.gemspec +1 -0
- data/lib/exactly/client.rb +16 -1
- data/lib/exactly/version.rb +1 -1
- metadata +63 -37
data/exactly.gemspec
CHANGED
data/lib/exactly/client.rb
CHANGED
@@ -1,4 +1,16 @@
|
|
1
1
|
module Exactly
|
2
|
+
class TriggeredSendFailed < StandardError
|
3
|
+
attr_reader :response
|
4
|
+
def initialize(response)
|
5
|
+
@response = response
|
6
|
+
super(message)
|
7
|
+
end
|
8
|
+
|
9
|
+
def message
|
10
|
+
@response.to_hash[:create_response][:results][:status_message]
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
2
14
|
class Client
|
3
15
|
def initialize(username, password)
|
4
16
|
client.wsse.credentials username, password
|
@@ -53,7 +65,7 @@ module Exactly
|
|
53
65
|
|
54
66
|
def triggered_send(customer_key, attributes)
|
55
67
|
attributes_without_email = attributes.reject{|k,v| k == :email}
|
56
|
-
client.request "CreateRequest", :xmlns => "http://exacttarget.com/wsdl/partnerAPI" do
|
68
|
+
response = client.request "CreateRequest", :xmlns => "http://exacttarget.com/wsdl/partnerAPI" do
|
57
69
|
http.headers['SOAPAction'] = 'Create'
|
58
70
|
soap.body = {
|
59
71
|
"Objects" => {
|
@@ -71,6 +83,9 @@ module Exactly
|
|
71
83
|
:attributes! => { "Objects" => { "xsi:type" => "TriggeredSend" }}
|
72
84
|
}
|
73
85
|
end
|
86
|
+
if response.to_hash[:create_response][:overall_status] != 'OK'
|
87
|
+
raise Exactly::TriggeredSendFailed.new(response)
|
88
|
+
end
|
74
89
|
end
|
75
90
|
end
|
76
91
|
end
|
data/lib/exactly/version.rb
CHANGED
metadata
CHANGED
@@ -1,39 +1,58 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: exactly
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 0
|
8
|
+
- 3
|
9
|
+
version: 0.0.3
|
6
10
|
platform: ruby
|
7
|
-
authors:
|
11
|
+
authors:
|
8
12
|
- Jacob Atzen
|
9
13
|
autorequire:
|
10
14
|
bindir: bin
|
11
15
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
none: false
|
18
|
-
requirements:
|
19
|
-
- - ! '>='
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: 0.9.5
|
16
|
+
|
17
|
+
date: 2012-12-07 00:00:00 +01:00
|
18
|
+
default_executable:
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
22
21
|
type: :runtime
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
22
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
segments:
|
27
|
+
- 0
|
28
|
+
- 9
|
29
|
+
- 5
|
29
30
|
version: 0.9.5
|
31
|
+
name: savon
|
32
|
+
requirement: *id001
|
33
|
+
prerelease: false
|
34
|
+
- !ruby/object:Gem::Dependency
|
35
|
+
type: :development
|
36
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
segments:
|
41
|
+
- 0
|
42
|
+
version: "0"
|
43
|
+
name: rake
|
44
|
+
requirement: *id002
|
45
|
+
prerelease: false
|
30
46
|
description: ExactTarget SOAP API client
|
31
|
-
email:
|
47
|
+
email:
|
32
48
|
- jacob@incremental.dk
|
33
49
|
executables: []
|
50
|
+
|
34
51
|
extensions: []
|
52
|
+
|
35
53
|
extra_rdoc_files: []
|
36
|
-
|
54
|
+
|
55
|
+
files:
|
37
56
|
- .gitignore
|
38
57
|
- Gemfile
|
39
58
|
- LICENSE
|
@@ -43,28 +62,35 @@ files:
|
|
43
62
|
- lib/exactly.rb
|
44
63
|
- lib/exactly/client.rb
|
45
64
|
- lib/exactly/version.rb
|
65
|
+
has_rdoc: true
|
46
66
|
homepage: http://github.com/lokalebasen/exactly
|
47
67
|
licenses: []
|
68
|
+
|
48
69
|
post_install_message:
|
49
70
|
rdoc_options: []
|
50
|
-
|
71
|
+
|
72
|
+
require_paths:
|
51
73
|
- lib
|
52
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
requirements:
|
61
|
-
- -
|
62
|
-
- !ruby/object:Gem::Version
|
63
|
-
|
74
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
75
|
+
requirements:
|
76
|
+
- - ">="
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
segments:
|
79
|
+
- 0
|
80
|
+
version: "0"
|
81
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
82
|
+
requirements:
|
83
|
+
- - ">="
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
segments:
|
86
|
+
- 0
|
87
|
+
version: "0"
|
64
88
|
requirements: []
|
89
|
+
|
65
90
|
rubyforge_project:
|
66
|
-
rubygems_version: 1.
|
91
|
+
rubygems_version: 1.3.6
|
67
92
|
signing_key:
|
68
93
|
specification_version: 3
|
69
94
|
summary: Making it easier to interact with ExactTargets SOAP API
|
70
95
|
test_files: []
|
96
|
+
|