send_with_us 3.1.0 → 4.0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d50c239efd64109971c40b8672b632ca5bfc3919
4
- data.tar.gz: bfcf5cb515ac7b97a5c2f0437401970299356b12
3
+ metadata.gz: 20f559ce008e420040ec7b495e4f47f7a3ae76b2
4
+ data.tar.gz: 73d4a26a72a2b0d072d6398b5377d63fef7370e6
5
5
  SHA512:
6
- metadata.gz: aae51ef349b4cf4632ac6cfd6c944e54973eefe6ac982824c40542284c8a92d2fa164a214c425a32d54436dbce5edff2aa4a76c7f6a05ad3f53fb7f4126e286d
7
- data.tar.gz: 9c926d10b52714d17a67e946dd3e18e8bf198d854cf2b0ad4128b73aa211b893c5061d6f734dd91c9db80883d136913bc21a554495cae015b6446220c236e12e
6
+ metadata.gz: 202796e78c60bdf82ecb6c624b5f0148a10f9c46f8e9a83f81e56df709ea97f5fe3b846e585de4dc7134487e14e2532e274b61cca00c93663926363ea9e66fbd
7
+ data.tar.gz: c19407602ab50efa1600d97580baccd97101af0fdb1bee19c0898149e58390aae5ad2e40dc5118bb76c06f1dc3ba47fd492f26e919be897e1b8d9d7e5541ad6f
@@ -1,3 +1,5 @@
1
+ 4.0.1 - Remove unused methods
2
+ 4.0.0 - Deprecate Logs List API endpoint
1
3
  3.1.0 - Add `strict` option to the render call
2
4
  3.0.0 - Deprecate and remove Conversions API calls
3
5
  2.0.0 - Deprecate Customer Groups API
data/README.md CHANGED
@@ -150,7 +150,7 @@ begin
150
150
  ],
151
151
  files: ['path/to/attachment.txt'],
152
152
  esp_account: 'esp_MYESPACCOUNT',
153
- version: 'v2',
153
+ version_name: 'v2',
154
154
  tags: ['tag1', 'tag2'],
155
155
  locale: 'en-US')
156
156
  puts result
@@ -214,6 +214,7 @@ end
214
214
  ```
215
215
 
216
216
  ### Remove Customer from Drip Campaign
217
+
217
218
  ```ruby
218
219
  require 'rubygems'
219
220
  require 'send_with_us'
@@ -285,23 +286,9 @@ result = obj.customer_create("visha@example.com")
285
286
  result = obj.customer_delete("visha@example.com")
286
287
  ```
287
288
 
288
- ### Get logs for customer
289
- This will retrieve email logs for a customer.
290
-
291
- Optional Arguments:
292
- - **count** – The number of logs to return. _Max: 100, Default: 100._
293
- - **created_gt** – Return logs created strictly after the given UTC timestamp.
294
- - **created_lt** – Return logs created strictly before the given UTC timestamp.
295
-
296
-
297
- ```ruby
298
- obj.customer_email_log('customer@example.com', count: 1)
299
- ```
300
-
301
289
  ## Templates
302
290
 
303
291
  ```ruby
304
-
305
292
  # List Templates
306
293
  obj.list_templates() # Alternatively, obj.emails()
307
294
 
@@ -314,12 +301,14 @@ obj.delete_template(template_id)
314
301
  # List Template Versions
315
302
  obj.list_template_versions(template_id)
316
303
 
304
+ # Get Template Version
305
+ obj.get_template_version(template_id, version_id)
306
+
317
307
  # Update Template Version
318
308
  obj.update_template_version(template_id, version_id, name, subject, html, text)
319
309
 
320
310
  # Create Template Version
321
311
  obj.create_template_version(template_id, name, subject, html, text)
322
-
323
312
  ```
324
313
 
325
314
 
@@ -353,16 +342,24 @@ Take a look at our Mailer that you can use similarly to ActionMailer
353
342
 
354
343
  ## Logs
355
344
 
345
+ ### Get single log
346
+
347
+ Used to get the details for a single log. The log ID can be obtained by recording the `receipt_id` value returned from the `send` call.
348
+
349
+ ```ruby
350
+ obj.log('log_sld7xWJ3isc23-3')
351
+ ```
352
+
353
+ ### Get logs for customer
354
+ This will retrieve email logs for a customer.
355
+
356
356
  Optional Arguments:
357
357
  - **count** – The number of logs to return. _Max: 100, Default: 100._
358
- - **offset** – Offset the number of logs to return. _Default: 0_
359
358
  - **created_gt** – Return logs created strictly after the given UTC timestamp.
360
- - **created_gte** – Return logs created on or after the given UTC timestamp.
361
359
  - **created_lt** – Return logs created strictly before the given UTC timestamp.
362
- - **created_lte** – Return logs created on or before the given UTC timestamp.
363
360
 
364
361
  ```ruby
365
- obj.logs(count: 1, offset: 1)
362
+ obj.customer_email_log('customer@example.com', count: 1)
366
363
  ```
367
364
 
368
365
  ## Errors
@@ -214,14 +214,6 @@ module SendWithUs
214
214
  SendWithUs::ApiRequest.new(@configuration).get("drip_campaigns/#{drip_campaign_id}")
215
215
  end
216
216
 
217
- def list_customers_on_campaign(drip_campaign_id)
218
- SendWithUs::ApiRequest.new(@configuration).get("drip_campaigns/#{drip_campaign_id}/customers")
219
- end
220
-
221
- def list_customers_on_campaign_step(drip_campaign_id, drip_campaign_step_id)
222
- SendWithUs::ApiRequest.new(@configuration).get("drip_campaigns/#{drip_campaign_id}/step/#{drip_campaign_step_id}/customers")
223
- end
224
-
225
217
  def customer_get(email)
226
218
  SendWithUs::ApiRequest.new(@configuration).get("customers/#{email}")
227
219
  end
@@ -258,25 +250,6 @@ module SendWithUs
258
250
  SendWithUs::ApiRequest.new(@configuration).get(endpoint)
259
251
  end
260
252
 
261
- def logs(options = {})
262
- endpoint = 'logs'
263
- params = {}
264
-
265
- params[:count] = options[:count] unless options[:count].nil?
266
- params[:offset] = options[:offset] unless options[:offset].nil?
267
- params[:created_gt] = options[:created_gt] unless options[:created_gt].nil?
268
- params[:created_gte] = options[:created_gte] unless options[:created_gte].nil?
269
- params[:created_lt] = options[:created_lt] unless options[:created_lt].nil?
270
- params[:created_lte] = options[:created_lte] unless options[:created_lte].nil?
271
-
272
- unless params.empty?
273
- params = URI.encode_www_form(params)
274
- endpoint = endpoint + '?' + params
275
- end
276
-
277
- SendWithUs::ApiRequest.new(@configuration).get(endpoint)
278
- end
279
-
280
253
  def log(log_id)
281
254
  endpoint = "logs/#{log_id}"
282
255
 
@@ -1,3 +1,3 @@
1
1
  module SendWithUs
2
- VERSION = '3.1.0'
2
+ VERSION = '4.0.1'
3
3
  end
@@ -260,12 +260,6 @@ class TestApiRequest < Minitest::Test
260
260
  assert_instance_of( Net::HTTPSuccess, @request.get(:'drip_campaigns') )
261
261
  end
262
262
 
263
- def test_get_with_params_for_logs
264
- build_objects
265
- Net::HTTP.any_instance.stubs(:request).returns(Net::HTTPSuccess.new(1.0, 200, "OK"))
266
- assert_instance_of( Net::HTTPSuccess, @request.get(:'logs', {count: 10}.to_json) )
267
- end
268
-
269
263
  def test_start_on_drip_campaign
270
264
  build_objects
271
265
  Net::HTTP.any_instance.stubs(:request).returns(Net::HTTPSuccess.new(1.0, 200, "OK"))
@@ -312,10 +306,4 @@ class TestApiRequest < Minitest::Test
312
306
  Net::HTTP.any_instance.stubs(:request).returns(Net::HTTPSuccess.new(1.0, 200, "OK"))
313
307
  assert_instance_of( Net::HTTPSuccess, @request.delete(:'customers/#{@customer[:email]}'))
314
308
  end
315
-
316
- def test_logs_with_options
317
- build_objects
318
- Net::HTTP.any_instance.stubs(:request).returns(Net::HTTPSuccess.new(1.0, 200, "OK"))
319
- assert_instance_of( Net::HTTPSuccess, @request.get(:'logs?count=2&offset=10'))
320
- end
321
309
  end
@@ -22,21 +22,6 @@ describe SendWithUs::Api do
22
22
  it('configs') { SendWithUs::Api.new( api_key: @custom_api_key ).configuration.api_key.must_equal @custom_api_key }
23
23
  end
24
24
 
25
- describe '#logs' do
26
- describe 'without options' do
27
- let(:options) { nil }
28
- before { SendWithUs::ApiRequest.any_instance.expects(:get).with('logs') }
29
-
30
- it { subject.logs }
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
25
  describe '#customer_email_log' do
41
26
  describe 'without options' do
42
27
  let(:options) { nil }
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: 3.1.0
4
+ version: 4.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Harris
@@ -12,48 +12,48 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2017-07-13 00:00:00.000000000 Z
15
+ date: 2017-08-04 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: rake
19
19
  requirement: !ruby/object:Gem::Requirement
20
20
  requirements:
21
- - - ">="
21
+ - - '>='
22
22
  - !ruby/object:Gem::Version
23
23
  version: '0'
24
24
  type: :development
25
25
  prerelease: false
26
26
  version_requirements: !ruby/object:Gem::Requirement
27
27
  requirements:
28
- - - ">="
28
+ - - '>='
29
29
  - !ruby/object:Gem::Version
30
30
  version: '0'
31
31
  - !ruby/object:Gem::Dependency
32
32
  name: shoulda
33
33
  requirement: !ruby/object:Gem::Requirement
34
34
  requirements:
35
- - - ">="
35
+ - - '>='
36
36
  - !ruby/object:Gem::Version
37
37
  version: '0'
38
38
  type: :development
39
39
  prerelease: false
40
40
  version_requirements: !ruby/object:Gem::Requirement
41
41
  requirements:
42
- - - ">="
42
+ - - '>='
43
43
  - !ruby/object:Gem::Version
44
44
  version: '0'
45
45
  - !ruby/object:Gem::Dependency
46
46
  name: mocha
47
47
  requirement: !ruby/object:Gem::Requirement
48
48
  requirements:
49
- - - ">="
49
+ - - '>='
50
50
  - !ruby/object:Gem::Version
51
51
  version: '0'
52
52
  type: :development
53
53
  prerelease: false
54
54
  version_requirements: !ruby/object:Gem::Requirement
55
55
  requirements:
56
- - - ">="
56
+ - - '>='
57
57
  - !ruby/object:Gem::Version
58
58
  version: '0'
59
59
  description: SendWithUs.com Ruby Client
@@ -63,10 +63,10 @@ executables: []
63
63
  extensions: []
64
64
  extra_rdoc_files: []
65
65
  files:
66
- - ".github/ISSUE_TEMPLATE"
67
- - ".github/PULL_REQUEST_TEMPLATE"
68
- - ".gitignore"
69
- - ".travis.yml"
66
+ - .github/ISSUE_TEMPLATE
67
+ - .github/PULL_REQUEST_TEMPLATE
68
+ - .gitignore
69
+ - .travis.yml
70
70
  - CHANGELOG.md
71
71
  - Gemfile
72
72
  - LICENSE
@@ -97,17 +97,17 @@ require_paths:
97
97
  - lib
98
98
  required_ruby_version: !ruby/object:Gem::Requirement
99
99
  requirements:
100
- - - ">="
100
+ - - '>='
101
101
  - !ruby/object:Gem::Version
102
102
  version: '0'
103
103
  required_rubygems_version: !ruby/object:Gem::Requirement
104
104
  requirements:
105
- - - ">="
105
+ - - '>='
106
106
  - !ruby/object:Gem::Version
107
107
  version: '0'
108
108
  requirements: []
109
109
  rubyforge_project:
110
- rubygems_version: 2.6.11
110
+ rubygems_version: 2.0.14.1
111
111
  signing_key:
112
112
  specification_version: 4
113
113
  summary: SendWithUs.com Ruby Client