office_boy 0.0.3 → 0.0.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 219e54ba936dc0e204c794b7f6e5e0b8a553a581bd4acfe578add3fbb91040bc
4
- data.tar.gz: 4c0cfb54f58afecf6d11a7d8f3b5363e99bb71efe9023bcd3ef9572b10447a08
3
+ metadata.gz: c57c52dab7063bdc21f3d142503e753e4b513f2661c829cf0af51aca76eba139
4
+ data.tar.gz: 9ee5cecc9e93e8a775c5f49572f99fae3c119c0c0fbd41cb6c16d75a39807eeb
5
5
  SHA512:
6
- metadata.gz: 67f4c5d762780f5bf2f49f54965ee08c8c7dc342f875d8670eb6b611ee03f1277c3bfb5f1516a8e57c0d8660c50285509707e8310e6fbf056aa025417b3acbe7
7
- data.tar.gz: 9734d98b85e085429512b1d8b8b5f655fe9bcc684779a9b5e878724e02f0dd1397ad2641f84fa5bab45ed9d2da34c42dfe30519897b3c01591189bebb2b717bd
6
+ metadata.gz: 177488ceb19b06f829b4917c69783af4d0bc0bd43d686ecd93cc0e457d175e7ff2afe9e8ece426636cc152976bf31cbbe3e542444138e4e8b3c0a1ad1be4ee11
7
+ data.tar.gz: 326628f586fde2783573c95e79f9eb7c184a27156d4a3f5e10eb3b75e2c46bb343b231a8d4dacf405e5db072b943c3a36136c91ba6f4154c7c92b276c1f78c9c
@@ -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
 
@@ -6,7 +6,7 @@ module OfficeBoy
6
6
  #
7
7
  # @return [String]
8
8
  def to_s
9
- "0.0.3"
9
+ "0.0.4"
10
10
  end
11
11
  end
12
12
  end
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.3
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
- rubyforge_project:
96
- rubygems_version: 2.7.6
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: []