goacoustic 0.1.1 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -2
- data/goacoustic.gemspec +6 -6
- data/lib/client/contact.rb +45 -2
- data/lib/goacoustic/version.rb +1 -1
- metadata +16 -26
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1417d4217b6e2bde103b8b7ddb1e3b5419146da85c4e55f0b77e5c30b5ea5eb6
|
4
|
+
data.tar.gz: 8514825ec209ac6cafe19a86b79a122aaabcc6cae675cfd21a96ff9fc0ff75ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e133b5f8f1d87ae4a95b7ae0ba9e0556fef6bab9e144d5005aebb9d381e3badf948293987959db95ac7217ef98c8919851c06a6e82133ef54940217859b8e87a
|
7
|
+
data.tar.gz: d52561d573b098a2437ce7e92b142a684c8cdb5526a77ca779065fec6cb0d59383fd30b925aadbc8966b429fc8d377c6017863eff640958750c9e03805b8c427
|
data/README.md
CHANGED
@@ -20,10 +20,15 @@ A Ruby wrapper for the Acoustic API
|
|
20
20
|
|
21
21
|
@client = GoAcoustic.new({access_token: access_token.token, url: "https://api-campaign-us-1.goacoustic.com"})
|
22
22
|
|
23
|
-
#
|
23
|
+
#add_recipient
|
24
24
|
#pass in user variables, database contact list, and contact list id
|
25
25
|
a = @client.add_recipient({email:"test@example.com"}, 123, [456])
|
26
|
-
|
26
|
+
a.Envelope.Body.RESULT.SUCCESS # => "TRUE"
|
27
|
+
|
28
|
+
#get_recipient
|
29
|
+
#pass in database id and recipient id or email
|
30
|
+
r = @client.get_recipient({email:"joe@schmoe.com"}, database_id, recipient_id, optional_fields)
|
31
|
+
r.Email # => "joe@schmoe.com"
|
27
32
|
|
28
33
|
## Contributing
|
29
34
|
In the spirit of [free software][free-sw], **everyone** is encouraged to help improve
|
data/goacoustic.gemspec
CHANGED
@@ -2,12 +2,12 @@
|
|
2
2
|
require File.expand_path('../lib/goacoustic/version', __FILE__)
|
3
3
|
|
4
4
|
Gem::Specification.new do |gem|
|
5
|
-
gem.add_dependency 'addressable', '
|
6
|
-
gem.add_dependency 'faraday', '
|
7
|
-
gem.add_dependency 'faraday_middleware', '
|
8
|
-
gem.add_dependency 'hashie', '
|
9
|
-
gem.add_dependency 'builder', '
|
10
|
-
gem.add_dependency 'multi_xml', '
|
5
|
+
gem.add_dependency 'addressable', '>= 2.7'
|
6
|
+
gem.add_dependency 'faraday', '>= 1.0'
|
7
|
+
gem.add_dependency 'faraday_middleware', '>= 1.0'
|
8
|
+
gem.add_dependency 'hashie', '>= 4.0'
|
9
|
+
gem.add_dependency 'builder', '>= 3.2'
|
10
|
+
gem.add_dependency 'multi_xml', '>= 0.6'
|
11
11
|
gem.add_development_dependency 'oauth2'
|
12
12
|
gem.add_development_dependency 'rdiscount'
|
13
13
|
gem.add_development_dependency 'yard'
|
data/lib/client/contact.rb
CHANGED
@@ -36,10 +36,53 @@ module GoAcoustic
|
|
36
36
|
builder.VALUE field[1]
|
37
37
|
}
|
38
38
|
end
|
39
|
-
}
|
40
39
|
}
|
41
40
|
}
|
42
|
-
|
41
|
+
}
|
42
|
+
post(xml)
|
43
|
+
end
|
44
|
+
|
45
|
+
# Retrieves a contact from a database
|
46
|
+
#
|
47
|
+
def get_recipient(fields, list_id, recipient_id=nil, options={})
|
48
|
+
builder = Builder::XmlMarkup.new
|
49
|
+
xml = builder.Envelope {
|
50
|
+
builder.Body {
|
51
|
+
builder.SelectRecipientData {
|
52
|
+
builder.LIST_ID list_id
|
53
|
+
if recipient_id
|
54
|
+
builder.RECIPIENT_ID recipient_id
|
55
|
+
builder.COLUMN {
|
56
|
+
builder.NAME "Recipient ID"
|
57
|
+
builder.VALUE recipient_id
|
58
|
+
}
|
59
|
+
end
|
60
|
+
if fields[:email]
|
61
|
+
builder.EMAIL fields[:email]
|
62
|
+
end
|
63
|
+
unless options.empty?
|
64
|
+
options.each do |opt|
|
65
|
+
builder.tag! opt[0], opt[1]
|
66
|
+
end
|
67
|
+
end
|
68
|
+
unless fields.empty?
|
69
|
+
fields.each do |field|
|
70
|
+
builder.COLUMN {
|
71
|
+
builder.NAME field[0].to_s
|
72
|
+
builder.VALUE field[1]
|
73
|
+
}
|
74
|
+
end
|
75
|
+
end
|
76
|
+
}
|
77
|
+
}
|
78
|
+
}
|
79
|
+
|
80
|
+
begin
|
81
|
+
response = post(xml)
|
82
|
+
response.Envelope.Body.RESULT
|
83
|
+
rescue
|
84
|
+
return false
|
85
|
+
end
|
43
86
|
end
|
44
87
|
|
45
88
|
end
|
data/lib/goacoustic/version.rb
CHANGED
metadata
CHANGED
@@ -1,97 +1,97 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: goacoustic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Anderson, Upworthy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '2.7'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '2.7'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: faraday
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '1.0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: faraday_middleware
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '1.0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '1.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: hashie
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '4.0'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '4.0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: builder
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '3.2'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - "
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '3.2'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: multi_xml
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - "
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '0.6'
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - "
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0.6'
|
97
97
|
- !ruby/object:Gem::Dependency
|
@@ -190,18 +190,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
190
190
|
- !ruby/object:Gem::Version
|
191
191
|
version: '0'
|
192
192
|
requirements: []
|
193
|
-
rubygems_version: 3.0.
|
193
|
+
rubygems_version: 3.0.3
|
194
194
|
signing_key:
|
195
195
|
specification_version: 4
|
196
196
|
summary: A Ruby wrapper for the Acoustic API
|
197
|
-
test_files:
|
198
|
-
- spec/client/contact_spec.rb
|
199
|
-
- spec/client/relational_table_spec.rb
|
200
|
-
- spec/client/reporting_spec.rb
|
201
|
-
- spec/client/user_spec.rb
|
202
|
-
- spec/fixtures/contact.xml
|
203
|
-
- spec/fixtures/relational_table.xml
|
204
|
-
- spec/fixtures/reporting.xml
|
205
|
-
- spec/fixtures/sent_mailings_org.xml
|
206
|
-
- spec/goacoustic_spec.rb
|
207
|
-
- spec/helper.rb
|
197
|
+
test_files: []
|