send_with_us 1.0.2 → 1.0.3

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: e80a927fbda0bc2deba7b51792a25a1dfbbb347d
4
- data.tar.gz: 5d690b0be9df8cf6978ca3bf00100b91187c453f
3
+ metadata.gz: 1855d28e92afbbc8840a2104d43649f8a9394aa6
4
+ data.tar.gz: 4431b30194b533bf8cc249cf96f1f0b79dff08ba
5
5
  SHA512:
6
- metadata.gz: 6d556742dcf3c279878663654b2a37993a2f961c26cf0ed30a9a357d586bedb41391a276997ce2b668930941a29bfb5745a9afb57c25c8e22c87d9fa1ca64db0
7
- data.tar.gz: 53fe3041bf2245bcac0dc669ebef11279afcafcbcd83cc14348ea0b67020128c3d410eb189ae5e4489fc9fb38787ed3e13f6d9350876b1b83848307de81078c9
6
+ metadata.gz: 2da0c049c3de26cc5f5c8b6617caf1c8de9a32f30b237fded0a1ceeb52cdca2b3efd50a31a8905f621ec3785a1c3f76213a82ac25878a2a20ae4ab2c242c2621
7
+ data.tar.gz: d72288f66bf58f4a2f7bff189544880783856834d2e9cc8f0be7281a9749c4559eb9e9fc7f6f53561e385d3ad8435710c14719032021af2b975c422f6137292a
data/CHANGELOG.md CHANGED
@@ -1,3 +1,4 @@
1
+ 1.0.3 - Don't allow nil email_id
1
2
  1.0.2 - More sensible error messages
2
3
  1.0.0 - Updated for v1_0 of SWU api. Added emails endpoint.
3
4
  0.0.4 - Rewritten to be more gem-like
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- send_with_us (1.0.2)
4
+ send_with_us (1.0.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,4 +1,5 @@
1
1
  module SendWithUs
2
+ class ApiNilEmailId < StandardError; end
2
3
 
3
4
  class Api
4
5
  attr_reader :configuration
@@ -21,6 +22,11 @@ module SendWithUs
21
22
  end
22
23
 
23
24
  def send_with(email_id, to, data = {}, from = {}, cc={}, bcc={})
25
+
26
+ if email_id.nil?
27
+ raise SendWithUs::ApiNilEmailId, 'email_id cannot be nil'
28
+ end
29
+
24
30
  payload = { email_id: email_id, recipient: to,
25
31
  email_data: data }
26
32
 
@@ -13,6 +13,7 @@ module SendWithUs
13
13
  end
14
14
 
15
15
  def send_with(payload)
16
+
16
17
  path = request_path(:send)
17
18
  request = Net::HTTP::Post.new(path, initheader = {'Content-Type' =>'application/json'})
18
19
  request.add_field('X-SWU-API-KEY', @configuration.api_key)
@@ -1,3 +1,3 @@
1
1
  module SendWithUs
2
- VERSION = '1.0.2'
2
+ VERSION = '1.0.3'
3
3
  end
data/send_with_us.gemspec CHANGED
@@ -7,7 +7,7 @@ require 'send_with_us/version'
7
7
  Gem::Specification.new do |gem|
8
8
  gem.name = "send_with_us"
9
9
  gem.version = SendWithUs::VERSION
10
- gem.authors = ["Matt Harris", "Chris Cummer"]
10
+ gem.authors = ["Matt Harris", "Chris Cummer", "Nicholas Rempel"]
11
11
  gem.email = ["us@sendwithus.com"]
12
12
  gem.description = %q{SendWithUs.com Ruby Client}
13
13
  gem.summary = %q{SendWithUs.com Ruby Client}
metadata CHANGED
@@ -1,15 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: send_with_us
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Harris
8
8
  - Chris Cummer
9
+ - Nicholas Rempel
9
10
  autorequire:
10
11
  bindir: bin
11
12
  cert_chain: []
12
- date: 2013-11-08 00:00:00.000000000 Z
13
+ date: 2013-11-13 00:00:00.000000000 Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: rake