send_with_us 4.3.0 → 4.4.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b6a246f1dd54a758295eb1b9ac7fd0d98daa6d0e5f7ffd7f6fa9a0216025ea79
4
- data.tar.gz: 8cd25be4990e4c71b1670c9f6e643df17bf959503f51856c158b94e050d26ed6
3
+ metadata.gz: f67c0ceffafb13f25e0f582159853931f7ad80cb021c49839d42f3fe950057f9
4
+ data.tar.gz: fc33de35c98767fef56a58837cd00d80c8a9490e37fb90c7a7ad241854377585
5
5
  SHA512:
6
- metadata.gz: 91d8aee785590e548f116dad433c0e04319eaa3fa293ae6c589f1d39e4b436630d6b14eed1c8dbe7d96c62cee379e93dd0bc0730ff4e28b1a813465a2e9ae3cd
7
- data.tar.gz: dccfdd92058ab69d73856c885e3df260829ba326d5333c8842201fb8f149e8b71a32db80106b5b43112ff7fbd65829f7f769d868bd06315280a750b70c943773
6
+ metadata.gz: 247e986c2ed5785fd6c5a719448a57da298056a00ac6a41eb4f44813931456c749856e1ff0b026ad12225483ba4c3a70a8bfb20f7e9cd8209a1bba340919e60f
7
+ data.tar.gz: 1ea7ae022f32cae2ceb89da6828d3978540218f9a9a02fce7faa7fe5752ac54fa6c0ff8e6cd5977c65cb2408a9a700b319b09cd7ef7684150712fe10d6fa204c
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 4.4.0
2
+ - **[#88](https://github.com/sendwithus/sendwithus_ruby/pull/88) Fix problematic `render` implementation.** `template_data` serves two purposes, defining template data and specifying the optional API parameter for `locale`. Previously, `locale` would be stripped out of `template_data` in the API request, preventing users from specifying variables named `locale` in their own template data.
3
+
1
4
  ## 4.3.0
2
5
  - Add optional `preheader` and `amp_html` fields to template calls
3
6
 
@@ -145,7 +145,7 @@ module SendWithUs
145
145
  alias list_templates emails
146
146
 
147
147
  def render(template_id, version_id = nil, template_data = {}, strict = false)
148
- locale = template_data.delete(:locale)
148
+ locale = template_data[:locale]
149
149
 
150
150
  payload = {
151
151
  template: template_id,
@@ -1,3 +1,3 @@
1
1
  module SendWithUs
2
- VERSION = '4.3.0'
2
+ VERSION = '4.4.0'
3
3
  end
@@ -99,4 +99,26 @@ describe SendWithUs::Api do
99
99
 
100
100
  it { subject.customer_get(email) }
101
101
  end
102
+
103
+ describe '#render' do
104
+ let(:locale) { 'fr-CA' }
105
+ let(:template_id) { 'template-id' }
106
+ let(:template_data) { { foo: 'bar', locale: locale } }
107
+ let(:strict) { true }
108
+ let(:version_id) { 'some-version-id' }
109
+
110
+ let(:payload) do
111
+ {
112
+ template: template_id,
113
+ template_data: template_data,
114
+ strict: strict,
115
+ version_id: version_id,
116
+ locale: locale,
117
+ }
118
+ end
119
+
120
+ before { SendWithUs::ApiRequest.any_instance.expects(:post).with(:render, payload.to_json) }
121
+
122
+ it { subject.render(template_id, version_id, template_data, strict) }
123
+ end
102
124
  end
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: 4.3.0
4
+ version: 4.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Harris
@@ -9,10 +9,10 @@ authors:
9
9
  - Nicholas Rempel
10
10
  - Gregory Schier
11
11
  - Brad Van Vugt
12
- autorequire:
12
+ autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2022-07-19 00:00:00.000000000 Z
15
+ date: 1980-01-01 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: rake
@@ -94,7 +94,7 @@ homepage: https://github.com/sendwithus/sendwithus_ruby
94
94
  licenses:
95
95
  - Apache-2.0
96
96
  metadata: {}
97
- post_install_message:
97
+ post_install_message:
98
98
  rdoc_options: []
99
99
  require_paths:
100
100
  - lib
@@ -109,8 +109,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  requirements: []
112
- rubygems_version: 3.0.3.1
113
- signing_key:
112
+ rubygems_version: 3.2.26
113
+ signing_key:
114
114
  specification_version: 4
115
115
  summary: SendWithUs.com Ruby Client
116
116
  test_files: