ocean-rails 3.7.6 → 3.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ocean/api.rb +39 -18
- data/lib/ocean/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5303f290af0cfe4a4d197ce0da1794e1dd55ac7
|
4
|
+
data.tar.gz: c127e595618a06d6c585eb15bbd1f4ab941c1c0a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2c085cb52eb32f7647d78d39bc0702f31f9aa84ee154656f2443faf22f92196fdddd623cf8b9b4bd882f6452f21b7a9bc239ed59a6d75e575f968f7bdc463cb
|
7
|
+
data.tar.gz: 73f5b03859b3f17f023b112c23841359ea501a7533ede7e73cb950b566bf6e3bc12647a861c949f9bad0fc5c783d06315e3851cbbcb3f73476b2d2ae0ab0c2ba
|
data/lib/ocean/api.rb
CHANGED
@@ -329,24 +329,6 @@ class Api
|
|
329
329
|
end
|
330
330
|
|
331
331
|
|
332
|
-
#
|
333
|
-
# Send an email asynchronously. The Mailer role is required.
|
334
|
-
#
|
335
|
-
def self.send_mail(from: "nobody@#{BASE_DOMAIN}", to: nil,
|
336
|
-
subject: nil,
|
337
|
-
plaintext: nil, html: nil,
|
338
|
-
plaintext_url: nil, html_url: nil, substitutions: nil)
|
339
|
-
Api.request "#{INTERNAL_OCEAN_API_URL}/v1/mails", :post,
|
340
|
-
x_api_token: Api.service_token, credentials: Api.credentials,
|
341
|
-
body: {
|
342
|
-
from: from, to: to, subject: subject,
|
343
|
-
plaintext: plaintext, html: html,
|
344
|
-
plaintext_url: plaintext_url, html_url: html_url,
|
345
|
-
substitutions: substitutions
|
346
|
-
}.to_json
|
347
|
-
end
|
348
|
-
|
349
|
-
|
350
332
|
#
|
351
333
|
# This escapes BAN request paths, which is needed as they are regexes.
|
352
334
|
#
|
@@ -503,4 +485,43 @@ class Api
|
|
503
485
|
end
|
504
486
|
|
505
487
|
|
488
|
+
#
|
489
|
+
# Send an email asynchronously. The Mailer role is required.
|
490
|
+
#
|
491
|
+
def self.send_mail(from: "nobody@#{BASE_DOMAIN}", to: nil,
|
492
|
+
subject: nil,
|
493
|
+
plaintext: nil, html: nil,
|
494
|
+
plaintext_url: nil, html_url: nil, substitutions: nil)
|
495
|
+
Api.request "#{INTERNAL_OCEAN_API_URL}/v1/mails", :post,
|
496
|
+
x_api_token: Api.service_token, credentials: Api.credentials,
|
497
|
+
body: {
|
498
|
+
from: from, to: to, subject: subject,
|
499
|
+
plaintext: plaintext, html: html,
|
500
|
+
plaintext_url: plaintext_url, html_url: html_url,
|
501
|
+
substitutions: substitutions
|
502
|
+
}.to_json
|
503
|
+
end
|
504
|
+
|
505
|
+
|
506
|
+
def self.async_job_body(href=nil, method=:get,
|
507
|
+
credentials: nil,
|
508
|
+
token: nil,
|
509
|
+
steps: nil,
|
510
|
+
default_step_time: nil,
|
511
|
+
default_poison_limit: nil,
|
512
|
+
max_seconds_in_queue: nil,
|
513
|
+
poison_email: nil)
|
514
|
+
h = {}
|
515
|
+
steps ||= href && [{"url" => Api.internalize_uri(href),
|
516
|
+
"method" => (method && method.to_s.upcase || "GET")}] ||
|
517
|
+
[]
|
518
|
+
h['steps'] = steps
|
519
|
+
h['credentials'] = credentials || Api.credentials
|
520
|
+
h['token'] = token || Api.service_token
|
521
|
+
h['default_step_time'] = default_step_time if default_step_time
|
522
|
+
h['default_poison_limit'] = default_poison_limit if default_poison_limit
|
523
|
+
h['max_seconds_in_queue'] = max_seconds_in_queue if max_seconds_in_queue
|
524
|
+
h['poison_email'] = poison_email if poison_email
|
525
|
+
h
|
526
|
+
end
|
506
527
|
end
|
data/lib/ocean/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ocean-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Bengtson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|