office_boy 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/office_boy/mail.rb +13 -11
- data/lib/office_boy/version.rb +1 -1
- metadata +5 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c57c52dab7063bdc21f3d142503e753e4b513f2661c829cf0af51aca76eba139
|
4
|
+
data.tar.gz: 9ee5cecc9e93e8a775c5f49572f99fae3c119c0c0fbd41cb6c16d75a39807eeb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 177488ceb19b06f829b4917c69783af4d0bc0bd43d686ecd93cc0e457d175e7ff2afe9e8ece426636cc152976bf31cbbe3e542444138e4e8b3c0a1ad1be4ee11
|
7
|
+
data.tar.gz: 326628f586fde2783573c95e79f9eb7c184a27156d4a3f5e10eb3b75e2c46bb343b231a8d4dacf405e5db072b943c3a36136c91ba6f4154c7c92b276c1f78c9c
|
data/lib/office_boy/mail.rb
CHANGED
@@ -2,7 +2,18 @@ module OfficeBoy
|
|
2
2
|
class Mail
|
3
3
|
def self.deliver(template:, attributes:)
|
4
4
|
raise Errors::NotDefiniedEmailTemplate unless OfficeBoy.configuration.templates.key?(template)
|
5
|
-
|
5
|
+
|
6
|
+
personalization = {
|
7
|
+
to: [{
|
8
|
+
email: attributes[:to_email],
|
9
|
+
name: attributes[:to_name]
|
10
|
+
}],
|
11
|
+
subject: attributes[:subject],
|
12
|
+
dynamic_template_data: attributes[:dynamic_template_data]
|
13
|
+
}
|
14
|
+
|
15
|
+
personalization[:bcc] = [{email: attributes[:bcc_email]}] if attributes[:bcc_email]
|
16
|
+
|
6
17
|
response = OfficeBoy::Request.call(
|
7
18
|
method_name: :post,
|
8
19
|
path: 'mail/send',
|
@@ -12,16 +23,7 @@ module OfficeBoy
|
|
12
23
|
name: attributes[:from_name]
|
13
24
|
},
|
14
25
|
template_id: OfficeBoy.configuration.templates[template],
|
15
|
-
personalizations: [
|
16
|
-
{
|
17
|
-
to: [{
|
18
|
-
email: attributes[:to_email],
|
19
|
-
name: attributes[:to_name]
|
20
|
-
}],
|
21
|
-
subject: attributes[:subject],
|
22
|
-
dynamic_template_data: attributes[:dynamic_template_data]
|
23
|
-
}
|
24
|
-
]
|
26
|
+
personalizations: [personalization]
|
25
27
|
}
|
26
28
|
)
|
27
29
|
|
data/lib/office_boy/version.rb
CHANGED
metadata
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: office_boy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paweł Dąbrowski
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
date: 2019-11-07 00:00:00.000000000 Z
|
@@ -77,7 +77,7 @@ homepage: http://github.com/rubyhero/office_boy
|
|
77
77
|
licenses:
|
78
78
|
- MIT
|
79
79
|
metadata: {}
|
80
|
-
post_install_message:
|
80
|
+
post_install_message:
|
81
81
|
rdoc_options: []
|
82
82
|
require_paths:
|
83
83
|
- lib
|
@@ -92,9 +92,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
92
92
|
- !ruby/object:Gem::Version
|
93
93
|
version: '0'
|
94
94
|
requirements: []
|
95
|
-
|
96
|
-
|
97
|
-
signing_key:
|
95
|
+
rubygems_version: 3.2.11
|
96
|
+
signing_key:
|
98
97
|
specification_version: 4
|
99
98
|
summary: Wrapper for the Sendgrid API addressed to the technical bloggers
|
100
99
|
test_files: []
|