send_with_us 1.11.5 → 1.12.0
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.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/README.md +13 -0
- data/lib/send_with_us/api.rb +21 -6
- data/lib/send_with_us/version.rb +1 -1
- data/test/lib/send_with_us/api_test.rb +23 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 78aa4c95fac765b5b16c9ee6ffa8505c41093388
|
4
|
+
data.tar.gz: 0bfb17b3d1c8715e7642e42581c1b34e5b03c049
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7538a5552bcb4bd38c4ef8673b64d75d0b2a490f688a7b93d7833786edfe421958b793a034e65bc4ed3666a022d1f7ed800db15abe2e70b336bc932cc3d64d82
|
7
|
+
data.tar.gz: 27fd496864cbde1aa97ceae56e909d0e31c33e86953e66c81af97c10e656846b9ea973428db96c7be2f2153ae2f6945893346034c5f6f3859ada218091bbd7ab
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -289,6 +289,19 @@ obj.customer_add_to_group(email_address, group_id)
|
|
289
289
|
obj.customer_remove_from_group(email_address, group_id)
|
290
290
|
```
|
291
291
|
|
292
|
+
### Get logs for customer
|
293
|
+
This will retrieve email logs for a customer.
|
294
|
+
|
295
|
+
Optional Arguments:
|
296
|
+
- **count** – The number of logs to return. _Max: 100, Default: 100._
|
297
|
+
- **created_gt** – Return logs created strictly after the given UTC timestamp.
|
298
|
+
- **created_lt** – Return logs created strictly before the given UTC timestamp.
|
299
|
+
|
300
|
+
|
301
|
+
```ruby
|
302
|
+
obj.customer_email_log('customer@example.com', count: 1)
|
303
|
+
```
|
304
|
+
|
292
305
|
### Customer Conversion Event
|
293
306
|
You can use the Conversion API to track conversion and revenue data events against your sent emails
|
294
307
|
|
data/lib/send_with_us/api.rb
CHANGED
@@ -277,10 +277,25 @@ module SendWithUs
|
|
277
277
|
SendWithUs::ApiRequest.new(@configuration).delete(endpoint)
|
278
278
|
end
|
279
279
|
|
280
|
-
def
|
281
|
-
endpoint = "logs"
|
280
|
+
def customer_email_log(email_address, options = {})
|
281
|
+
endpoint = "customers/#{email_address}/logs"
|
282
|
+
params = {}
|
283
|
+
|
284
|
+
params[:count] = options[:count] unless options[:count].nil?
|
285
|
+
params[:created_gt] = options[:created_gt] unless options[:created_gt].nil?
|
286
|
+
params[:created_lt] = options[:created_lt] unless options[:created_lt].nil?
|
282
287
|
|
283
|
-
params
|
288
|
+
unless params.empty?
|
289
|
+
params = URI.encode_www_form(params)
|
290
|
+
endpoint = endpoint + '?' + params
|
291
|
+
end
|
292
|
+
|
293
|
+
SendWithUs::ApiRequest.new(@configuration).get(endpoint)
|
294
|
+
end
|
295
|
+
|
296
|
+
def logs(options = {})
|
297
|
+
endpoint = 'logs'
|
298
|
+
params = {}
|
284
299
|
|
285
300
|
params[:count] = options[:count] unless options[:count].nil?
|
286
301
|
params[:offset] = options[:offset] unless options[:offset].nil?
|
@@ -289,9 +304,9 @@ module SendWithUs
|
|
289
304
|
params[:created_lt] = options[:created_lt] unless options[:created_lt].nil?
|
290
305
|
params[:created_lte] = options[:created_lte] unless options[:created_lte].nil?
|
291
306
|
|
292
|
-
unless params
|
293
|
-
params
|
294
|
-
endpoint = endpoint +
|
307
|
+
unless params.empty?
|
308
|
+
params = URI.encode_www_form(params)
|
309
|
+
endpoint = endpoint + '?' + params
|
295
310
|
end
|
296
311
|
|
297
312
|
SendWithUs::ApiRequest.new(@configuration).get(endpoint)
|
data/lib/send_with_us/version.rb
CHANGED
@@ -29,6 +29,29 @@ describe SendWithUs::Api do
|
|
29
29
|
|
30
30
|
it { subject.logs }
|
31
31
|
end
|
32
|
+
describe 'with options' do
|
33
|
+
let(:options) { { count: 2 } }
|
34
|
+
before { SendWithUs::ApiRequest.any_instance.expects(:get).with('logs?count=2') }
|
35
|
+
|
36
|
+
it { subject.logs(options) }
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
describe '#customer_email_log' do
|
41
|
+
describe 'without options' do
|
42
|
+
let(:options) { nil }
|
43
|
+
let(:email) { 'some@email.stub' }
|
44
|
+
before { SendWithUs::ApiRequest.any_instance.expects(:get).with("customers/#{email}/logs") }
|
45
|
+
|
46
|
+
it { subject.customer_email_log(email) }
|
47
|
+
end
|
48
|
+
describe 'with options' do
|
49
|
+
let(:options) { { count: 2 } }
|
50
|
+
let(:email) { 'some@email.stub' }
|
51
|
+
before { SendWithUs::ApiRequest.any_instance.expects(:get).with("customers/#{email}/logs?count=2") }
|
52
|
+
|
53
|
+
it { subject.customer_email_log(email, options) }
|
54
|
+
end
|
32
55
|
end
|
33
56
|
|
34
57
|
describe '#log' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: send_with_us
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Harris
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2016-
|
15
|
+
date: 2016-03-18 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: rake
|