goacoustic 0.1.1 → 0.1.2
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/lib/client/contact.rb +39 -1
- data/lib/goacoustic/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9465d7cdb78a36ee592fd8f16958bdd5395888c0d428a6df36b512f28deb524f
|
4
|
+
data.tar.gz: f2d69942589fda15603306ae79f6f51022bf54033fca7c33801f35a976388a04
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5fdd379b432d868aea714a95f8ed037cae4ede3e573fdfc9a260ab4d8f41270ba4cf16234e4fc36a98176f6c3ffee93f9aa37f1fb85c8e8b4ab8f67229af11fe
|
7
|
+
data.tar.gz: 2a86ffad3f6c6b61c75843909ece6bceffe61824009d0c3bba3013f8947f720061f4e202d8e9e65239442acdc5160e0b30628e2190761f1cce86a3c8f5b6d8b2
|
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
|
30
|
+
r = @client.get_recipient(123, 456, [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/lib/client/contact.rb
CHANGED
@@ -36,10 +36,48 @@ module GoAcoustic
|
|
36
36
|
builder.VALUE field[1]
|
37
37
|
}
|
38
38
|
end
|
39
|
+
}
|
40
|
+
}
|
41
|
+
}
|
42
|
+
post(xml)
|
43
|
+
end
|
44
|
+
|
45
|
+
# Retrieves a contact from a database
|
46
|
+
#
|
47
|
+
def get_recipient(list_id, recipient_id, fields=[], options={})
|
48
|
+
builder = Builder::XmlMarkup.new
|
49
|
+
xml = builder.Envelope {
|
50
|
+
builder.Body {
|
51
|
+
builder.SelectRecipientData {
|
52
|
+
builder.LIST_ID list_id
|
53
|
+
builder.RECIPIENT_ID recipient_id
|
54
|
+
builder.COLUMN {
|
55
|
+
builder.NAME "Recipient ID"
|
56
|
+
builder.VALUE recipient_id
|
39
57
|
}
|
58
|
+
unless options.empty?
|
59
|
+
options.each do |opt|
|
60
|
+
builder.tag! opt[0], opt[1]
|
61
|
+
end
|
62
|
+
end
|
63
|
+
unless fields.empty?
|
64
|
+
fields.each do |field|
|
65
|
+
builder.COLUMN {
|
66
|
+
builder.NAME field[0].to_s
|
67
|
+
builder.VALUE field[1]
|
68
|
+
}
|
69
|
+
end
|
70
|
+
end
|
40
71
|
}
|
41
72
|
}
|
42
|
-
|
73
|
+
}
|
74
|
+
|
75
|
+
begin
|
76
|
+
response = post(xml)
|
77
|
+
response.Envelope.Body.RESULT
|
78
|
+
rescue
|
79
|
+
return false
|
80
|
+
end
|
43
81
|
end
|
44
82
|
|
45
83
|
end
|
data/lib/goacoustic/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Anderson, Upworthy
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-02-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -175,7 +175,7 @@ homepage: http://www.github.com/harman-signal-processing/goacoustic
|
|
175
175
|
licenses:
|
176
176
|
- BSD-3-Clause
|
177
177
|
metadata: {}
|
178
|
-
post_install_message:
|
178
|
+
post_install_message:
|
179
179
|
rdoc_options: []
|
180
180
|
require_paths:
|
181
181
|
- lib
|
@@ -190,8 +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.
|
194
|
-
signing_key:
|
193
|
+
rubygems_version: 3.1.2
|
194
|
+
signing_key:
|
195
195
|
specification_version: 4
|
196
196
|
summary: A Ruby wrapper for the Acoustic API
|
197
197
|
test_files:
|