mailpace-rails 0.4.1 → 0.4.2
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/README.md +4 -0
- data/lib/mailpace-rails/version.rb +1 -1
- data/lib/mailpace-rails.rb +13 -6
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4bddf2babf3726e39c5bcf3d3866bbe97920ae3013864a328e3621f8dd72c3ab
|
4
|
+
data.tar.gz: 03f854b13967e2f5e5e31f83935522d734dcfd001cec171ac243f496d5b83355
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 861485b876d02f2565a938fb397f9737cce872939e162640303f998d15a3ccf986a2a7e49b4e838d283680fbd4df4dfca6588c02ed1c25b9a368ec5bede0fe1c
|
7
|
+
data.tar.gz: 06b646a8c7e65121e44e117171d233ff600217d73a16623bb829d8a407dbc59b6c7999f4f8e9cb8aeb48a8abd8cdee1424334870bbf2e28be69ddfbca9792d76
|
data/README.md
CHANGED
@@ -155,6 +155,10 @@ class TestMailer < ApplicationMailer
|
|
155
155
|
end
|
156
156
|
```
|
157
157
|
|
158
|
+
## ActiveStorage Configuration
|
159
|
+
|
160
|
+
This gem depends on ActiveStorage for handling inbound emails. If you do not have ActiveStorage configured in your Rails App you may need to create an empty file `config/storage.yml` for this Gem to work.
|
161
|
+
|
158
162
|
## Support
|
159
163
|
|
160
164
|
For support please check the [MailPace Documentation](https://docs.mailpace.com) or contact us at support@mailpace.com
|
data/lib/mailpace-rails.rb
CHANGED
@@ -17,20 +17,27 @@ module Mailpace
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def deliver!(mail)
|
20
|
+
if mail.multipart?
|
21
|
+
htmlbody = mail.html_part.body.decoded,
|
22
|
+
textbody = mail.text_part.body.decoded
|
23
|
+
elsif mail.mime_type == "text/plain"
|
24
|
+
textbody = mail.body.to_s
|
25
|
+
else
|
26
|
+
htmlbody = mail.body.to_s
|
27
|
+
end
|
28
|
+
|
20
29
|
check_delivery_params(mail)
|
21
30
|
result = HTTParty.post(
|
22
31
|
'https://app.mailpace.com/api/v1/send',
|
23
32
|
body: {
|
24
33
|
from: address_list(mail.header[:from])&.addresses&.first.to_s,
|
25
|
-
to: mail.to
|
34
|
+
to: address_list(mail.header[:to])&.addresses&.join(','),
|
26
35
|
subject: mail.subject,
|
27
|
-
htmlbody:
|
28
|
-
textbody:
|
29
|
-
mail.text_part ? mail.text_part.body.decoded : nil
|
30
|
-
end,
|
36
|
+
htmlbody: htmlbody,
|
37
|
+
textbody: textbody,
|
31
38
|
cc: address_list(mail.header[:cc])&.addresses&.join(','),
|
32
39
|
bcc: address_list(mail.header[:bcc])&.addresses&.join(','),
|
33
|
-
replyto: mail.reply_to&.join(','),
|
40
|
+
replyto: address_list(mail.header[:reply_to])&.addresses&.join(','),
|
34
41
|
inreplyto: mail.header['In-Reply-To'].to_s,
|
35
42
|
references: mail.header['References'].to_s,
|
36
43
|
list_unsubscribe: mail.header['list_unsubscribe'].to_s,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mailpace-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- MailPace
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionmailer
|
@@ -131,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
131
131
|
- !ruby/object:Gem::Version
|
132
132
|
version: '0'
|
133
133
|
requirements: []
|
134
|
-
rubygems_version: 3.5.
|
134
|
+
rubygems_version: 3.5.22
|
135
135
|
signing_key:
|
136
136
|
specification_version: 4
|
137
137
|
summary: Lets you send transactional emails from your app over an easy to use API
|