mailpy 0.1.5 → 0.1.6
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 +3 -1
- data/lib/mailpy/mailer_api.rb +14 -3
- data/lib/mailpy/version.rb +1 -1
- 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: 21476287a915391df402c2d12dd74a6665e594c1b5eec0a5e19d75f59544fc1e
|
4
|
+
data.tar.gz: 49f4380a0e2d0ec8e7fb07063b7a969d46374ac332dfef8487066372a97e5e1b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ca3d484f041f422d8c9d1b97102d3177e678ce5795014220237c9716f8b2fd099cab5d544928ec1cc57e43b93ca9171899a24a97894e6d1e45ab8f3c4055c09
|
7
|
+
data.tar.gz: f09f2eae711235ab0320344db3e535c690844261f611be0cc7c600c8b556849ad6e0490025b31aaf0264b6e2725b1826d083820ea28958b8928cb9cf18e3b997
|
data/README.md
CHANGED
@@ -17,7 +17,9 @@ Add configuration to your application environments. development.rb, staging.rb,
|
|
17
17
|
config.action_mailer.delivery_method = :mailpy
|
18
18
|
config.action_mailer.mailpy_settings = {
|
19
19
|
endpoint: ENV['MAILER_API_ENDPOINT'],
|
20
|
-
|
20
|
+
headers: {
|
21
|
+
Authorization: ENV['MAILER_API_KEY_OR_AUTH_TOKEN']
|
22
|
+
}
|
21
23
|
}
|
22
24
|
```
|
23
25
|
|
data/lib/mailpy/mailer_api.rb
CHANGED
@@ -24,11 +24,22 @@ class MailerApi
|
|
24
24
|
bcc: mail.bcc.try(:join, ', '),
|
25
25
|
from: mail.from.try(:join, ', '),
|
26
26
|
subject: mail.subject,
|
27
|
-
body:
|
28
|
-
|
27
|
+
body: body_data,
|
28
|
+
attachment: attachment_data
|
29
|
+
}
|
30
|
+
end
|
31
|
+
|
32
|
+
def body_data
|
33
|
+
mail.body.parts.present? ? mail.body.parts[0].body.to_s : mail.body.to_s
|
34
|
+
end
|
35
|
+
|
36
|
+
def attachment_data
|
37
|
+
attachments = {}
|
38
|
+
mail.attachments.each { |attachment| attachments[attachment.filename] = attachment.body }
|
39
|
+
attachments
|
29
40
|
end
|
30
41
|
|
31
42
|
def headers
|
32
|
-
|
43
|
+
options[:headers]
|
33
44
|
end
|
34
45
|
end
|
data/lib/mailpy/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mailpy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nasrul Gunawan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-02-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|