send_with_us 4.3.0 → 4.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/send_with_us/api.rb +1 -1
- data/lib/send_with_us/version.rb +1 -1
- data/test/lib/send_with_us/api_test.rb +22 -0
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f67c0ceffafb13f25e0f582159853931f7ad80cb021c49839d42f3fe950057f9
|
4
|
+
data.tar.gz: fc33de35c98767fef56a58837cd00d80c8a9490e37fb90c7a7ad241854377585
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
|
data/lib/send_with_us/api.rb
CHANGED
@@ -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
|
148
|
+
locale = template_data[:locale]
|
149
149
|
|
150
150
|
payload = {
|
151
151
|
template: template_id,
|
data/lib/send_with_us/version.rb
CHANGED
@@ -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.
|
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:
|
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.
|
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:
|