mail-ses 1.0.1 → 1.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 +4 -4
- data/CHANGELOG.md +13 -0
- data/lib/mail/ses/options_builder.rb +26 -5
- data/lib/mail/ses/version.rb +1 -1
- data/lib/mail/ses.rb +0 -7
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a689b342f844767cae3e35b937b0e95bb997d61087989f78f21ed8b48977d318
|
4
|
+
data.tar.gz: 989ef38af6e8cf6bd32cfb0ec8dee37ecbf272652609fcca140c169b4f02626f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6bb222bc4117cb8136ae3a91e3e2eff7cfff64f2b7b303f7c5d02ca9b6bb298c193006ce6b3f2daadd09df3b8bc27daefe7499a18323247ed3fe17a9ff56667
|
7
|
+
data.tar.gz: e7d4b9dbfb1056a6211b16bf5764835e9768b1fb67db77ada7f5fd060c6e9158a22440bfadd83e75ba8be561469bfcd53ffdac876dc034c1481fa6c8395741a7
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,18 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
### 1.0.4
|
4
|
+
|
5
|
+
- Fix missing method error related to message headers.
|
6
|
+
|
7
|
+
### 1.0.3
|
8
|
+
|
9
|
+
- Support UTF-8 chars in from, to, etc addresses.
|
10
|
+
|
11
|
+
### 1.0.2
|
12
|
+
|
13
|
+
- Fix labels in being stripped from email addresses.
|
14
|
+
- Support Reply-To address.
|
15
|
+
|
3
16
|
### 1.0.1
|
4
17
|
|
5
18
|
- Add compatibility with Mail gem 2.8.0.
|
@@ -4,6 +4,14 @@ module Mail
|
|
4
4
|
class SES
|
5
5
|
# Builds options for Aws::SESV2::Client#send_email
|
6
6
|
class OptionsBuilder
|
7
|
+
SES_FIELDS = %i[ from_email_address
|
8
|
+
from_email_address_identity_arn
|
9
|
+
reply_to_addresses
|
10
|
+
feedback_forwarding_email_address
|
11
|
+
feedback_forwarding_email_address_identity_arn
|
12
|
+
email_tags
|
13
|
+
configuration_set_name ].freeze
|
14
|
+
|
7
15
|
# message - The Mail::Message object to be sent.
|
8
16
|
# options - The Hash options which override any defaults
|
9
17
|
# from the message.
|
@@ -20,16 +28,18 @@ module Mail
|
|
20
28
|
private
|
21
29
|
|
22
30
|
def ses_options
|
23
|
-
|
31
|
+
# TODO: address fields should be encoded to UTF-8
|
32
|
+
slice_hash(@options, *SES_FIELDS)
|
24
33
|
end
|
25
34
|
|
26
35
|
def message_options
|
27
36
|
{
|
28
|
-
from_email_address:
|
37
|
+
from_email_address: extract_value(:from)&.first,
|
38
|
+
reply_to_addresses: extract_value(:reply_to),
|
29
39
|
destination: {
|
30
|
-
to_addresses:
|
31
|
-
cc_addresses:
|
32
|
-
bcc_addresses:
|
40
|
+
to_addresses: extract_value(:to) || [],
|
41
|
+
cc_addresses: extract_value(:cc) || [],
|
42
|
+
bcc_addresses: extract_value(:bcc) || []
|
33
43
|
},
|
34
44
|
content: { raw: { data: @message.to_s } }
|
35
45
|
}.compact
|
@@ -38,6 +48,17 @@ module Mail
|
|
38
48
|
def slice_hash(hash, *keys)
|
39
49
|
keys.each_with_object({}) { |k, h| h[k] = hash[k] if hash.key?(k) }
|
40
50
|
end
|
51
|
+
|
52
|
+
def extract_value(key)
|
53
|
+
value = @message.header[key]
|
54
|
+
return unless value.respond_to?(:formatted)
|
55
|
+
|
56
|
+
value.formatted&.map { |v| encode(v) }
|
57
|
+
end
|
58
|
+
|
59
|
+
def encode(value)
|
60
|
+
Mail::Encodings.address_encode(value)
|
61
|
+
end
|
41
62
|
end
|
42
63
|
end
|
43
64
|
end
|
data/lib/mail/ses/version.rb
CHANGED
data/lib/mail/ses.rb
CHANGED
@@ -7,13 +7,6 @@ require 'mail/ses/options_builder'
|
|
7
7
|
module Mail
|
8
8
|
# Mail delivery method handler for AWS SES
|
9
9
|
class SES
|
10
|
-
RAW_EMAIL_ATTRS = %i[ from_email_address
|
11
|
-
from_email_address_identity_arn
|
12
|
-
feedback_forwarding_email_address
|
13
|
-
feedback_forwarding_email_address_identity_arn
|
14
|
-
email_tags
|
15
|
-
configuration_set_name ].freeze
|
16
|
-
|
17
10
|
attr_accessor :settings
|
18
11
|
attr_reader :client
|
19
12
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mail-ses
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Johnny Shields
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-07-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-sesv2
|