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 +4 -4
- data/CHANGELOG.md +8 -0
- data/Gemfile.lock +1 -1
- data/lib/enveloop/client.rb +10 -1
- data/lib/enveloop/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a3906e5d57e00185b12ee7f3280bbbcf527520f99e0781d01d5d892b0b7237e
|
4
|
+
data.tar.gz: cd0b0620c7223c1039b2048c02956caf66804c36274b5da3fd034b981d5bcabd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
data/lib/enveloop/client.rb
CHANGED
@@ -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(
|
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
|
data/lib/enveloop/version.rb
CHANGED
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
|
+
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:
|
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.
|
73
|
+
rubygems_version: 3.3.5
|
74
74
|
signing_key:
|
75
75
|
specification_version: 4
|
76
76
|
summary: Envelope API wrapper
|