enveloop 0.1.2 → 0.1.4

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: 596fdbbb2ebc6cc7b533c13225b7d3b9230dcf272a075348c845e8c57326dc33
4
- data.tar.gz: 950931ce5bbc9c41b4ed9cea7551b33af8ddef4b4d13886163a5cb2f99208520
3
+ metadata.gz: 03deb0e2f652d3b98a9026de59f8fc988eb7e37ae437f3f54d7714ceddcb221a
4
+ data.tar.gz: 2a7f3d3295ad5218f2834d0e94a5b84e8f13cc65bc9dc54766ab91f199733485
5
5
  SHA512:
6
- metadata.gz: 8168eb794ad27972124baf57e0f0d68041a01f640b2a3477aef89aa05aa4ee3838aab33ddd99a37f29c03679476b30fcf42fa2d992ba470acf6ecc24deadb720
7
- data.tar.gz: b84e89cec6e6dcc54411a6bbf090274b6e1fbd7471a3a820aaa4be496946a41877144b92e7026f7655baac42019d11d00dc6b877b2993b994bbd8a359378e88b
6
+ metadata.gz: f500db8fc4ed3e1839d17d2aa2b69ff7790b01d92ec48c5f1c4397a941c729e8d6859f2c9dde0de7d4d97085f3564567f299cd68a16918f423e8bd1a0f944856
7
+ data.tar.gz: a6c3dc00ad0daefe4b89ec39d7723287fab2bab196812b1eb2a055b1285c251cb818467b97bdb559c96840ce02430fde72f7948bb2428e9a07a5f219d4e3240a
data/CHANGELOG.md CHANGED
@@ -11,4 +11,14 @@
11
11
 
12
12
  > ## Version 0.1.2
13
13
 
14
- * add `template_info` to fetch the template body and see waht variables are defined on a template
14
+ * add `template_info` to fetch the template body and see waht variables are defined on a template
15
+
16
+ > ## Version 0.1.3
17
+
18
+ * change `user_variables` to `template_variables` in API call
19
+
20
+ > ## Version 0.1.4
21
+
22
+ * Do not require `from` in api call to allow for default from in template
23
+ * Do not require `subject` in api call to allow for default subject in template
24
+ * send `Sdk-Version` header for tracking of SDK usage and future deprection warnings
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- enveloop (0.1.2)
4
+ enveloop (0.1.4)
5
5
  faraday
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -20,19 +20,23 @@ Or install it yourself as:
20
20
 
21
21
  ## Usage
22
22
 
23
- SEnd a message:
23
+ Setup the client connection:
24
24
 
25
25
  ```ruby
26
26
  require 'enveloop'
27
27
 
28
28
  enveloop = Enveloop::Client.new(api_key: ENV['ENVELOOP_API_TOKEN'])
29
+ ```
30
+
31
+ Send a message:
29
32
 
33
+ ```ruby
30
34
  enveloop.send_message(
31
35
  template: 'welcome-email',
32
36
  to: 'user@email.com',
33
37
  from: 'welcome@myapp.com',
34
38
  subject: 'Welcome to MyApp',
35
- user_variables: {
39
+ template_variables: {
36
40
  first_name: 'John',
37
41
  }
38
42
  )
@@ -41,10 +45,6 @@ enveloop.send_message(
41
45
  Get information about a template (variables and body html):
42
46
 
43
47
  ```ruby
44
- require 'enveloop'
45
-
46
- enveloop = Enveloop::Client.new(api_key: ENV['ENVELOOP_API_TOKEN'])
47
-
48
48
  enveloop.template_info(template: 'welcome-email')
49
49
  ```
50
50
 
@@ -5,19 +5,20 @@ module Enveloop
5
5
  @api_key = api_key
6
6
  end
7
7
 
8
- def send_message(template:, to:, from:, subject:, user_variables: {})
8
+ def send_message(template:, to:, from: nil, subject: nil, template_variables: {})
9
9
  data = {
10
10
  to: to,
11
11
  from: from,
12
12
  subject: subject,
13
- userVariables: user_variables
13
+ templateVariables: template_variables
14
14
  }
15
15
 
16
16
  conn = Faraday.new(
17
17
  url: @endpoint,
18
18
  headers: {
19
19
  "Content-Type" => "application/json",
20
- "Authorization" => "token #{@api_key}"
20
+ "Authorization" => "token #{@api_key}",
21
+ "Sdk-Version" => "ruby-#{Enveloop::VERSION}"
21
22
  }
22
23
  )
23
24
 
@@ -42,4 +43,4 @@ module Enveloop
42
43
  return TemplateResponse.new(status: response.status, body: response.body)
43
44
  end
44
45
  end
45
- end
46
+ end
@@ -18,4 +18,4 @@ module Enveloop
18
18
  @status == 200
19
19
  end
20
20
  end
21
- end
21
+ end
@@ -18,4 +18,4 @@ module Enveloop
18
18
  @status == 200
19
19
  end
20
20
  end
21
- end
21
+ end
@@ -1,3 +1,3 @@
1
1
  module Enveloop
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.4"
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.2
4
+ version: 0.1.4
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-07 00:00:00.000000000 Z
11
+ date: 2022-10-25 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.2
73
+ rubygems_version: 3.1.4
74
74
  signing_key:
75
75
  specification_version: 4
76
76
  summary: Envelope API wrapper