postmail_ruby 0.1.3 → 0.1.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/lib/postmail_ruby/delivery_method/http.rb +4 -4
- data/lib/postmail_ruby/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: 7c5fa264c1d733166a1db09939c27525d767dc296503fb832d75791a968af57e
|
4
|
+
data.tar.gz: 01ac234e3745cfc52f728247ea6bfca7c5379a2ff80894a23db8a6d405fd28ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 62f90ef2298e2d2d16869299d5ee6adc03b5557482eced9626fd4b7e41cba5cf95621070bc5dddf9312af4996c500ee947237ba6a47ea46e83e8f38db2711ba8
|
7
|
+
data.tar.gz: f4831553a8df684a43346026b565cf1e3cb63e33be7533c68a773f88a83fc8747812684abe71314415495172e796e8e80f70d1793f8d043cc6071980924242fc
|
@@ -98,12 +98,12 @@ module PostmailRuby
|
|
98
98
|
# multipart messages, the first matching part "../../postmail_ruby/delivery_method""."is returned.
|
99
99
|
# For non-multipart, the body is returned if the MIME type
|
100
100
|
# matches. Returns nil if no matching part "../../postmail_ruby/delivery_method""."exists.
|
101
|
-
def extract_part(mail,
|
101
|
+
def extract_part(mail, mime_type_prefix)
|
102
102
|
if mail.multipart?
|
103
|
-
mail.parts.find { |p| p.mime_type&.start_with?(
|
104
|
-
part
|
103
|
+
part = mail.parts.find { |p| p.mime_type&.start_with?(mime_type_prefix) }
|
104
|
+
part&.body&.decoded
|
105
105
|
else
|
106
|
-
mail.mime_type&.start_with?(
|
106
|
+
mail.mime_type&.start_with?(mime_type_prefix) ? mail.body&.decoded : nil
|
107
107
|
end
|
108
108
|
end
|
109
109
|
|