mandrill_batch_mailer 1.1.0 → 1.2.0
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6bac2f4986ed43a2fb60b64ed86a252d06259272
|
4
|
+
data.tar.gz: de04ce3c0a9fa5e8d948c711cba4bc928162c51b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a667d9c11af6eace318b242abce10936e28c8a25e4a9bc84e2f3da4adafd68ccea3368ae9ca9aa4c2762741444e0bc8cb230fcb22b76328d3f90fecd48c15f1c
|
7
|
+
data.tar.gz: fdc3623efb4bf7e56a37761fb402ed4bd41f4e6a46a7c7f5d76ff5a700404712dc3a128dcf8e7991b173a97036e465fbd9dbfc7dbc08f1c37c97d6366473c09d
|
@@ -8,6 +8,8 @@ module MandrillBatchMailer
|
|
8
8
|
'send-template.json'
|
9
9
|
|
10
10
|
config_accessor :perform_deliveries,
|
11
|
+
:open_timeout,
|
12
|
+
:read_timeout,
|
11
13
|
:intercept_recipients,
|
12
14
|
:interception_base_mail,
|
13
15
|
:from_email,
|
@@ -15,6 +17,8 @@ module MandrillBatchMailer
|
|
15
17
|
:api_key
|
16
18
|
|
17
19
|
self.perform_deliveries = false
|
20
|
+
self.open_timeout = 30
|
21
|
+
self.read_timeout = 180
|
18
22
|
self.intercept_recipients = false
|
19
23
|
self.interception_base_mail = ''
|
20
24
|
|
@@ -196,7 +196,7 @@ module MandrillBatchMailer
|
|
196
196
|
|
197
197
|
def send_template(params)
|
198
198
|
if MandrillBatchMailer.perform_deliveries
|
199
|
-
|
199
|
+
rest_client_send params
|
200
200
|
params
|
201
201
|
else
|
202
202
|
log_sending(params)
|
@@ -214,5 +214,14 @@ module MandrillBatchMailer
|
|
214
214
|
MandrillBatchMailer.logger
|
215
215
|
.info "Sending Mandrill Mail: #{params_inspect}"
|
216
216
|
end
|
217
|
+
|
218
|
+
def rest_client_send(params)
|
219
|
+
RestClient::Request.execute(
|
220
|
+
method: :post,
|
221
|
+
url: MandrillBatchMailer::ENDPOINT,
|
222
|
+
payload: params.to_json,
|
223
|
+
read_timeout: MandrillBatchMailer.read_timeout,
|
224
|
+
open_timeout: MandrillBatchMailer.open_timeout)
|
225
|
+
end
|
217
226
|
end
|
218
227
|
end
|
@@ -256,8 +256,12 @@ describe MandrillBatchMailer::BaseMailer do
|
|
256
256
|
context 'when delivering', :deliver do
|
257
257
|
|
258
258
|
it "calls mandrill's endoint, when performing deliveries" do
|
259
|
-
expect(RestClient).to receive(:
|
260
|
-
|
259
|
+
expect(RestClient::Request).to receive(:execute).with(
|
260
|
+
method: :post,
|
261
|
+
url: MandrillBatchMailer::ENDPOINT,
|
262
|
+
payload: params.to_json,
|
263
|
+
read_timeout: 180,
|
264
|
+
open_timeout: 30)
|
261
265
|
test_mailer.send :send_template, params
|
262
266
|
end
|
263
267
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mandrill_batch_mailer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- schasse
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|