ohmysmtp-rails 0.1.9 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/lib/ohmysmtp-rails/version.rb +1 -1
- data/lib/ohmysmtp-rails.rb +6 -3
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a597f7e583471f790c1e7b669ad4e9b5f1327675cc176f28016eab512cb0c7dc
|
4
|
+
data.tar.gz: 631b23bdb932677707e24ddc4009c708843702d0ec2f44fc9b658c1beaccca2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 908d2acb45d4b64fe17b2091da1b9289dd614f7c6d4f4a61698f17c39fab396a123994932e1281720a993a6a430b73baec18eec654bcfdb639a046f6bf22c63a
|
7
|
+
data.tar.gz: 9cf4965645ce0f8d51320d8441516b311a5d833b8257159c1cd19d003a22a993a025056712dc02cb29b088c234ba73022ef86297766ed2e450c0e6cf13e390ad
|
data/README.md
CHANGED
@@ -106,6 +106,10 @@ end
|
|
106
106
|
|
107
107
|
Note that this should always be a string, even if using an array of multiple tags.
|
108
108
|
|
109
|
+
## List-Unsubscribe
|
110
|
+
|
111
|
+
To add a List-Unsubscribe header: ``
|
112
|
+
|
109
113
|
## Support
|
110
114
|
|
111
115
|
For support please check the [OhMySMTP Documentation](https://docs.ohmysmtp.com) or contact us at support@ohmysmtp.com
|
data/lib/ohmysmtp-rails.rb
CHANGED
@@ -12,7 +12,7 @@ module OhMySMTP
|
|
12
12
|
|
13
13
|
def initialize(values)
|
14
14
|
check_api_token(values)
|
15
|
-
self.settings = {}.merge!(values)
|
15
|
+
self.settings = { return_response: true }.merge!(values)
|
16
16
|
end
|
17
17
|
|
18
18
|
def deliver!(mail)
|
@@ -24,10 +24,13 @@ module OhMySMTP
|
|
24
24
|
to: mail.to.join(','),
|
25
25
|
subject: mail.subject,
|
26
26
|
htmlbody: mail.html_part ? mail.html_part.body.decoded : mail.body.to_s,
|
27
|
-
textbody: mail.multipart?
|
27
|
+
textbody: if mail.multipart?
|
28
|
+
mail.text_part ? mail.text_part.body.decoded : nil
|
29
|
+
end,
|
28
30
|
cc: mail.cc&.join(','),
|
29
31
|
bcc: mail.bcc&.join(','),
|
30
32
|
replyto: mail.reply_to,
|
33
|
+
list_unsubscribe: mail.header['list_unsubscribe'].to_s,
|
31
34
|
attachments: format_attachments(mail.attachments),
|
32
35
|
tags: mail.header['tags'].to_s
|
33
36
|
}.delete_if { |_key, value| value.blank? }.to_json,
|
@@ -57,7 +60,7 @@ module OhMySMTP
|
|
57
60
|
end
|
58
61
|
|
59
62
|
def handle_response(result)
|
60
|
-
return unless result.code != 200
|
63
|
+
return result unless result.code != 200
|
61
64
|
|
62
65
|
# TODO: Improved error handling
|
63
66
|
res = result.parsed_response
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ohmysmtp-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- OhMySMTP
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-12-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionmailer
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 6.1.
|
47
|
+
version: 6.1.4.1
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 6.1.
|
54
|
+
version: 6.1.4.1
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: sqlite3
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|