send_with_us 1.4.3 → 1.5.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.
@@ -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='')
26
+ def send_with(email_id, to, data = {}, from = {}, cc = {}, bcc = {}, files = [], esp_account = '', version_name = '', headers = {})
27
27
 
28
28
  if email_id.nil?
29
29
  raise SendWithUs::ApiNilEmailId, 'email_id cannot be nil'
@@ -47,6 +47,9 @@ module SendWithUs
47
47
  if version_name
48
48
  payload[:version_name] = version_name
49
49
  end
50
+ if headers
51
+ payload[:headers] = headers
52
+ end
50
53
 
51
54
  files.each do |path|
52
55
  file = open(path).read
@@ -1,3 +1,3 @@
1
1
  module SendWithUs
2
- VERSION = '1.4.3'
2
+ VERSION = '1.5.0'
3
3
  end
@@ -85,6 +85,24 @@ class TestApiRequest < MiniTest::Unit::TestCase
85
85
  assert_instance_of( Net::HTTPOK, result )
86
86
  end
87
87
 
88
+ def test_send_with_headers
89
+ build_objects
90
+ email_id = 'tem_9YvYsaLW2Mw4tmPiLcVvpC'
91
+ result = @api.send_with(
92
+ email_id,
93
+ {name: 'Ruby Unit Test', address: 'matt@example.com'},
94
+ {name: 'sendwithus', address: 'matt@example.com'},
95
+ {},
96
+ [],
97
+ [],
98
+ [],
99
+ '',
100
+ 'v2',
101
+ {'X-MY-HEADER' => 'foo'}
102
+ )
103
+ assert_instance_of( Net::HTTPOK, result )
104
+ end
105
+
88
106
  def test_emails
89
107
  build_objects
90
108
  Net::HTTP.any_instance.stubs(:request).returns(Net::HTTPSuccess.new(1.0, 200, "OK"))
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.3
4
+ version: 1.5.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2014-11-20 00:00:00.000000000 Z
14
+ date: 2014-11-28 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rake
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
108
  version: '0'
109
109
  requirements: []
110
110
  rubyforge_project:
111
- rubygems_version: 1.8.23.2
111
+ rubygems_version: 1.8.23
112
112
  signing_key:
113
113
  specification_version: 3
114
114
  summary: SendWithUs.com Ruby Client