eco-helpers 2.1.3 → 2.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -2
- data/lib/eco/api/common/session/mailer.rb +11 -4
- data/lib/eco/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca676558c0e1a885b1f9e15d68e3c4f3688b90713c88182854b426a8ce1bf447
|
4
|
+
data.tar.gz: 41e8693e90664d7789040dd2dab66521e330693a9ae62f7bb5c5bc2dbd940911
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 65b5157cc78ff3016f932283e2f0504e46681e15dc2acd902bb0e6188af98f5fe5271ad0db49a48fe969c642df3146daffeffcb0008dda3012433450dbbc1e87
|
7
|
+
data.tar.gz: 3a23f58986631f819b18bd8395ec92c321e9cb21bfde172a3e565df309cdad3b759d1d60f8c4bf52cff29332b49607f30afad19c90a80c5f9fb974637c3b218e
|
data/CHANGELOG.md
CHANGED
@@ -1,19 +1,24 @@
|
|
1
1
|
# Change Log
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
|
4
|
-
## [2.1.
|
4
|
+
## [2.1.5] - 2022-10-xx
|
5
5
|
|
6
6
|
### Added
|
7
7
|
### Changed
|
8
8
|
### Fixed
|
9
9
|
|
10
|
+
## [2.1.4] - 2022-10-20
|
11
|
+
|
12
|
+
### Added
|
13
|
+
- `Eco::API::Common::Session::Mailer#mail` added parameters `cc` and `bcc`
|
14
|
+
|
10
15
|
## [2.1.3] - 2022-10-11
|
11
16
|
|
12
17
|
### Added
|
13
18
|
- `Eco::API::UseCases::OozeSamples::OozeBaseCase`
|
14
19
|
- `with_fields`, `with_sections` and `add_field` accept an `entry` parameter
|
15
20
|
- also did some internal refactor
|
16
|
-
|
21
|
+
|
17
22
|
### Changed
|
18
23
|
- Upgraded `ecoportal-api-v2` **gem**
|
19
24
|
|
@@ -16,11 +16,9 @@ module Eco
|
|
16
16
|
# @param to [String] destination email address
|
17
17
|
# @param subject [String] subject of the email
|
18
18
|
# @param body [String] `html` or plain text message
|
19
|
-
def mail(to: nil, subject:, body:)
|
19
|
+
def mail(to: nil, subject:, body:, cc: nil, bcc: nil)
|
20
20
|
ses.send_email(
|
21
|
-
destination:
|
22
|
-
to_addresses: [fetch_to(to)].flatten,
|
23
|
-
},
|
21
|
+
destination: fetch_destination(to: to, cc: cc, bcc: bcc),
|
24
22
|
source: fetch_from,
|
25
23
|
message: {
|
26
24
|
subject: {
|
@@ -64,6 +62,15 @@ module Eco
|
|
64
62
|
@enviro.config || {}
|
65
63
|
end
|
66
64
|
|
65
|
+
def fetch_destination(to: nil, cc: nil, bcc: nil)
|
66
|
+
cc_to = [cc].flatten.compact.uniq
|
67
|
+
bcc_to = [bcc].flatten.compact.uniq
|
68
|
+
{ to_addresses: [fetch_to(to)].flatten }.tap do |dest|
|
69
|
+
dest.merge!(cc_addresses: cc_to) unless cc_to.empty?
|
70
|
+
dest.merge!(bcc_addresses: bcc_to) unless bcc_to.empty?
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
67
74
|
def fetch_to(value = nil)
|
68
75
|
value || config.mailer.to
|
69
76
|
end
|
data/lib/eco/version.rb
CHANGED