send_with_us 1.10.1 → 1.10.2
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 +4 -4
- data/CHANGELOG.md +8 -7
- data/README.md +1 -0
- data/lib/send_with_us/api.rb +6 -4
- data/lib/send_with_us/api_request.rb +7 -5
- data/lib/send_with_us/error.rb +4 -0
- data/lib/send_with_us/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5021ab6ee37c8f3b1d4be8ab74cfbfe91b20c173
|
4
|
+
data.tar.gz: abc9a8e4320ff642bc7c468e4b5523d111926359
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26fde0be9902431e523a578ecae187fc0b5ee1c86fcc63a498f213000ca045b79abc392bf53de57d8e8ad25c3a20bbfee82e838e9be63050c63a9da9aac56f30
|
7
|
+
data.tar.gz: 9f662b934c66196d03b31b451b4c6335eac3122ba1e94ea267b0f164967cb8db4c6c7286093259f4bb45650f27f7c30ddf33cd011ae21a60f8c1d9d4e8f9519f
|
data/CHANGELOG.md
CHANGED
@@ -1,16 +1,17 @@
|
|
1
|
+
1.10.2 - include render parameter on locale
|
1
2
|
1.10.1 - tag support, error base class, logs method
|
2
|
-
1.9.0 - Locale support. Introduce
|
3
|
-
1.8.0 - Tags support for
|
4
|
-
1.7.0 -
|
5
|
-
1.6.0 -
|
6
|
-
1.5.0 -
|
3
|
+
1.9.0 - Locale support. Introduce send\_email(). Deprecate send\_with().
|
4
|
+
1.8.0 - Tags support for send\_with
|
5
|
+
1.7.0 -
|
6
|
+
1.6.0 -
|
7
|
+
1.5.0 -
|
7
8
|
1.4.3 - Add customer add/deletion support
|
8
9
|
1.1.4 - Add Drips v2.0 support
|
9
10
|
1.0.5 - Add attachment support
|
10
11
|
1.0.4 - Add drip campaign unsubscribe support
|
11
|
-
1.0.3 - Don't allow nil
|
12
|
+
1.0.3 - Don't allow nil email\_id
|
12
13
|
1.0.2 - More sensible error messages
|
13
|
-
1.0.0 - Updated for
|
14
|
+
1.0.0 - Updated for v1\_0 of SWU api. Added emails endpoint.
|
14
15
|
0.0.4 - Rewritten to be more gem-like
|
15
16
|
- Accepts configuration via a Rails-style initializer
|
16
17
|
- Test coverage
|
data/README.md
CHANGED
@@ -189,6 +189,7 @@ end
|
|
189
189
|
- **email\_id** - *string* - Template ID being rendered
|
190
190
|
- **version\_id** - *string* - Version ID to render (optional)
|
191
191
|
- **data** - *hash* - Email data to render the template with (optional)
|
192
|
+
- **data[:locale]** - *hash value* - This option specifies the locale to render (optional)
|
192
193
|
|
193
194
|
```ruby
|
194
195
|
require 'rubygems'
|
data/lib/send_with_us/api.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
require "base64"
|
2
|
+
require_relative "error"
|
2
3
|
|
3
4
|
module SendWithUs
|
4
|
-
class ApiNilEmailId <
|
5
|
+
class ApiNilEmailId < Error; end
|
5
6
|
|
6
7
|
class Api
|
7
8
|
attr_reader :configuration
|
@@ -149,14 +150,15 @@ module SendWithUs
|
|
149
150
|
end
|
150
151
|
|
151
152
|
def render(template_id, version_id = nil, template_data = {})
|
153
|
+
locale = template_data.delete(:locale)
|
154
|
+
|
152
155
|
payload = {
|
153
156
|
template_id: template_id,
|
154
157
|
template_data: template_data,
|
155
158
|
}
|
156
159
|
|
157
|
-
if version_id
|
158
|
-
|
159
|
-
end
|
160
|
+
payload[:version_id] = version_id if version_id
|
161
|
+
payload[:locale] = locale if locale
|
160
162
|
|
161
163
|
payload = payload.to_json
|
162
164
|
SendWithUs::ApiRequest.new(@configuration).post(:'render', payload)
|
@@ -1,9 +1,11 @@
|
|
1
|
+
require_relative "error"
|
2
|
+
|
1
3
|
module SendWithUs
|
2
|
-
class ApiInvalidEndpoint <
|
3
|
-
class ApiConnectionRefused <
|
4
|
-
class ApiBadRequest <
|
5
|
-
class ApiInvalidKey <
|
6
|
-
class ApiUnknownError <
|
4
|
+
class ApiInvalidEndpoint < Error; end
|
5
|
+
class ApiConnectionRefused < Error; end
|
6
|
+
class ApiBadRequest < Error; end
|
7
|
+
class ApiInvalidKey < Error; end
|
8
|
+
class ApiUnknownError < Error; end
|
7
9
|
|
8
10
|
class ApiRequest
|
9
11
|
attr_reader :response
|
data/lib/send_with_us/version.rb
CHANGED
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: 1.10.
|
4
|
+
version: 1.10.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Harris
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-06-
|
13
|
+
date: 2015-06-11 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rake
|
@@ -74,6 +74,7 @@ files:
|
|
74
74
|
- lib/send_with_us/api_request.rb
|
75
75
|
- lib/send_with_us/attachment.rb
|
76
76
|
- lib/send_with_us/config.rb
|
77
|
+
- lib/send_with_us/error.rb
|
77
78
|
- lib/send_with_us/version.rb
|
78
79
|
- send_with_us.gemspec
|
79
80
|
- test/lib/send_with_us/api_request_test.rb
|
@@ -102,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
102
103
|
version: '0'
|
103
104
|
requirements: []
|
104
105
|
rubyforge_project:
|
105
|
-
rubygems_version: 2.
|
106
|
+
rubygems_version: 2.4.6
|
106
107
|
signing_key:
|
107
108
|
specification_version: 4
|
108
109
|
summary: SendWithUs.com Ruby Client
|