enveloop 0.1.4 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 03deb0e2f652d3b98a9026de59f8fc988eb7e37ae437f3f54d7714ceddcb221a
4
- data.tar.gz: 2a7f3d3295ad5218f2834d0e94a5b84e8f13cc65bc9dc54766ab91f199733485
3
+ metadata.gz: 5a3906e5d57e00185b12ee7f3280bbbcf527520f99e0781d01d5d892b0b7237e
4
+ data.tar.gz: cd0b0620c7223c1039b2048c02956caf66804c36274b5da3fd034b981d5bcabd
5
5
  SHA512:
6
- metadata.gz: f500db8fc4ed3e1839d17d2aa2b69ff7790b01d92ec48c5f1c4397a941c729e8d6859f2c9dde0de7d4d97085f3564567f299cd68a16918f423e8bd1a0f944856
7
- data.tar.gz: a6c3dc00ad0daefe4b89ec39d7723287fab2bab196812b1eb2a055b1285c251cb818467b97bdb559c96840ce02430fde72f7948bb2428e9a07a5f219d4e3240a
6
+ metadata.gz: 02a7e12cb859a178afb988f01fe82f3f1b5301d9810c7bc42220b62e7ef32614a80e7cf60ffea5302cd3c42c52f36c7309a95c563ffcbe43ab2e7f34d2cd09c3
7
+ data.tar.gz: b6bfab95266eebaaf830839903411d4082ff19f18fdd28b83dcc66359d309311c11e589f8ecd63ff88a965a419ca7b09cc833211bc13eb943cd54c031cedc1f7
data/CHANGELOG.md CHANGED
@@ -22,3 +22,11 @@
22
22
  * Do not require `from` in api call to allow for default from in template
23
23
  * Do not require `subject` in api call to allow for default subject in template
24
24
  * send `Sdk-Version` header for tracking of SDK usage and future deprection warnings
25
+
26
+ > ## Version 0.1.5
27
+
28
+ * Use new `/messages` endpoint
29
+
30
+ > ## Version 0.1.6
31
+
32
+ * Raise ruby errors when an error is encountered in the API
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- enveloop (0.1.4)
4
+ enveloop (0.1.5)
5
5
  faraday
6
6
 
7
7
  GEM
@@ -10,6 +10,7 @@ module Enveloop
10
10
  to: to,
11
11
  from: from,
12
12
  subject: subject,
13
+ template: template,
13
14
  templateVariables: template_variables
14
15
  }
15
16
 
@@ -22,10 +23,14 @@ module Enveloop
22
23
  }
23
24
  )
24
25
 
25
- response = conn.post("/templates/#{template}") do |req|
26
+ response = conn.post('/messages') do |req|
26
27
  req.body = data.to_json
27
28
  end
28
29
 
30
+ if response.status == 500
31
+ raise Enveloop::Error.new(JSON.parse(response.body)['error'])
32
+ end
33
+
29
34
  return MessageResponse.new(status: response.status, body: response.body)
30
35
  end
31
36
 
@@ -40,6 +45,10 @@ module Enveloop
40
45
 
41
46
  response = conn.get("/templates/#{template}")
42
47
 
48
+ if response.status == 500
49
+ raise Enveloop::Error.new(JSON.parse(response.body)['error'])
50
+ end
51
+
43
52
  return TemplateResponse.new(status: response.status, body: response.body)
44
53
  end
45
54
  end
@@ -1,3 +1,3 @@
1
1
  module Enveloop
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enveloop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Wyrosdick
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-10-25 00:00:00.000000000 Z
11
+ date: 2023-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -70,7 +70,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
70
70
  - !ruby/object:Gem::Version
71
71
  version: '0'
72
72
  requirements: []
73
- rubygems_version: 3.1.4
73
+ rubygems_version: 3.3.5
74
74
  signing_key:
75
75
  specification_version: 4
76
76
  summary: Envelope API wrapper