send_with_us 1.7.0 → 1.8.0

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ 1.8.0 - Tags support for send_with
2
+ 1.7.0 -
3
+ 1.6.0 -
4
+ 1.5.0 -
1
5
  1.4.3 - Add customer add/deletion support
2
6
  1.1.4 - Add Drips v2.0 support
3
7
  1.0.5 - Add attachment support
data/README.md CHANGED
@@ -34,6 +34,7 @@ bundle install
34
34
  - **esp\_account** - *string* - ESP account used to send email
35
35
  - **version\_name** - *string* - version of template to send
36
36
  - **headers** - *hash* - custom email headers **NOTE** only supported by some ESPs
37
+ - **tags** - *array* - array of strings to attach as tags
37
38
 
38
39
 
39
40
  For any Ruby project:
@@ -23,7 +23,7 @@ module SendWithUs
23
23
  @configuration = SendWithUs::Config.new(settings)
24
24
  end
25
25
 
26
- def send_with(email_id, to, data = {}, from = {}, cc = {}, bcc = {}, files = [], esp_account = '', version_name = '', headers = {})
26
+ def send_with(email_id, to, data = {}, from = {}, cc = {}, bcc = {}, files = [], esp_account = '', version_name = '', headers = {}, tags = [])
27
27
 
28
28
  if email_id.nil?
29
29
  raise SendWithUs::ApiNilEmailId, 'email_id cannot be nil'
@@ -47,9 +47,12 @@ module SendWithUs
47
47
  if version_name
48
48
  payload[:version_name] = version_name
49
49
  end
50
- if headers
50
+ if headers.any?
51
51
  payload[:headers] = headers
52
52
  end
53
+ if tags.any?
54
+ payload[:tags] = tags
55
+ end
53
56
 
54
57
  if files.any?
55
58
  payload[:files] = []
@@ -1,3 +1,3 @@
1
1
  module SendWithUs
2
- VERSION = '1.7.0'
2
+ VERSION = '1.8.0'
3
3
  end
@@ -103,6 +103,25 @@ class TestApiRequest < MiniTest::Unit::TestCase
103
103
  assert_instance_of( Net::HTTPOK, result )
104
104
  end
105
105
 
106
+ def test_send_with_tags
107
+ build_objects
108
+ email_id = 'tem_9YvYsaLW2Mw4tmPiLcVvpC'
109
+ result = @api.send_with(
110
+ email_id,
111
+ {name: 'Ruby Unit Test', address: 'matt@example.com'},
112
+ {name: 'sendwithus', address: 'matt@example.com'},
113
+ {},
114
+ [],
115
+ [],
116
+ [],
117
+ '',
118
+ 'v2',
119
+ {},
120
+ ['tag1', 'tag2']
121
+ )
122
+ assert_instance_of( Net::HTTPOK, result )
123
+ end
124
+
106
125
  def test_render
107
126
  build_objects
108
127
  email_id = 'tem_9YvYsaLW2Mw4tmPiLcVvpC'
metadata CHANGED
@@ -1,7 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: send_with_us
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.8.0
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Matt Harris
@@ -10,48 +11,54 @@ authors:
10
11
  autorequire:
11
12
  bindir: bin
12
13
  cert_chain: []
13
- date: 2014-12-19 00:00:00.000000000 Z
14
+ date: 2015-01-06 00:00:00.000000000 Z
14
15
  dependencies:
15
16
  - !ruby/object:Gem::Dependency
16
17
  name: rake
17
18
  requirement: !ruby/object:Gem::Requirement
19
+ none: false
18
20
  requirements:
19
- - - '>='
21
+ - - ! '>='
20
22
  - !ruby/object:Gem::Version
21
23
  version: '0'
22
24
  type: :development
23
25
  prerelease: false
24
26
  version_requirements: !ruby/object:Gem::Requirement
27
+ none: false
25
28
  requirements:
26
- - - '>='
29
+ - - ! '>='
27
30
  - !ruby/object:Gem::Version
28
31
  version: '0'
29
32
  - !ruby/object:Gem::Dependency
30
33
  name: shoulda
31
34
  requirement: !ruby/object:Gem::Requirement
35
+ none: false
32
36
  requirements:
33
- - - '>='
37
+ - - ! '>='
34
38
  - !ruby/object:Gem::Version
35
39
  version: '0'
36
40
  type: :development
37
41
  prerelease: false
38
42
  version_requirements: !ruby/object:Gem::Requirement
43
+ none: false
39
44
  requirements:
40
- - - '>='
45
+ - - ! '>='
41
46
  - !ruby/object:Gem::Version
42
47
  version: '0'
43
48
  - !ruby/object:Gem::Dependency
44
49
  name: mocha
45
50
  requirement: !ruby/object:Gem::Requirement
51
+ none: false
46
52
  requirements:
47
- - - '>='
53
+ - - ! '>='
48
54
  - !ruby/object:Gem::Version
49
55
  version: '0'
50
56
  type: :development
51
57
  prerelease: false
52
58
  version_requirements: !ruby/object:Gem::Requirement
59
+ none: false
53
60
  requirements:
54
- - - '>='
61
+ - - ! '>='
55
62
  - !ruby/object:Gem::Version
56
63
  version: '0'
57
64
  description: SendWithUs.com Ruby Client
@@ -85,26 +92,27 @@ files:
85
92
  homepage: https://github.com/sendwithus/sendwithus_ruby
86
93
  licenses:
87
94
  - Apache-2.0
88
- metadata: {}
89
95
  post_install_message:
90
96
  rdoc_options: []
91
97
  require_paths:
92
98
  - lib
93
99
  required_ruby_version: !ruby/object:Gem::Requirement
100
+ none: false
94
101
  requirements:
95
- - - '>='
102
+ - - ! '>='
96
103
  - !ruby/object:Gem::Version
97
104
  version: '0'
98
105
  required_rubygems_version: !ruby/object:Gem::Requirement
106
+ none: false
99
107
  requirements:
100
- - - '>='
108
+ - - ! '>='
101
109
  - !ruby/object:Gem::Version
102
110
  version: '0'
103
111
  requirements: []
104
112
  rubyforge_project:
105
- rubygems_version: 2.0.14
113
+ rubygems_version: 1.8.23.2
106
114
  signing_key:
107
- specification_version: 4
115
+ specification_version: 3
108
116
  summary: SendWithUs.com Ruby Client
109
117
  test_files:
110
118
  - test/lib/send_with_us/api_request_test.rb
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: d6f051528f2e3214a82b3447fc0d3965dd614848
4
- data.tar.gz: f743aa1c6a72b8bddb178722c0d55978700283dd
5
- SHA512:
6
- metadata.gz: 493cfbea63a120844f4f3bfa6eb72653a618b20bae54e8e71a7f13a8393249db77dc62812fa733240024fd08a8d4510c73b617da6b360e8caa3182d64772d3a4
7
- data.tar.gz: 068ec297df720fe877cd2b71090f62ac6e5199e7c61baee8f4e5d8f72c458243520428930096eef364f7affc32ebf174d09ba6b406d081426ad1c307636638ab