maily 0.11.0 → 0.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/MIT-LICENSE +1 -1
- data/app/controllers/maily/emails_controller.rb +15 -0
- data/lib/maily/generator.rb +1 -3
- data/lib/maily/version.rb +1 -1
- 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: 1089b608a601adb322f549ed2801017a2b1c3d3431cc384353080a5a92c39d02
|
4
|
+
data.tar.gz: b2764ddefc33668fe33bf416189ee4768e96e9df9037d8819be8e81b19bef292
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef3ecb6e741c94fd348926b49cb7a2c30452ff9e21280f560dcdbfacb5bae03a4ac087e08f38663bac28a41c9fba81541d4d5b37d6ea3396d6df86a4814969b3
|
7
|
+
data.tar.gz: eb66fdba4c9f5cc8c4d3aa2c5e0a717074cf021e9d980da5c16c3e162f18a81fef92220d5cc9719ce3374c2de5ba65c7b3957161d82f9a8e6b5cf0c6842d71e3
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
|
5
|
+
## [0.12.0]
|
6
|
+
|
7
|
+
- Support inline attachments (#30)
|
8
|
+
|
5
9
|
## [0.11.0]
|
6
10
|
|
7
11
|
- Support arrays in hooks (#42)
|
@@ -123,6 +127,7 @@ All notable changes to this project will be documented in this file.
|
|
123
127
|
|
124
128
|
- First real usable release :tada:
|
125
129
|
|
130
|
+
[0.12.0]: https://github.com/markets/maily/compare/v0.11.0...v0.12.0
|
126
131
|
[0.11.0]: https://github.com/markets/maily/compare/v0.10.1...v0.11.0
|
127
132
|
[0.10.1]: https://github.com/markets/maily/compare/v0.10.0...v0.10.1
|
128
133
|
[0.10.0]: https://github.com/markets/maily/compare/v0.9.1...v0.10.0
|
data/MIT-LICENSE
CHANGED
@@ -25,6 +25,7 @@ module Maily
|
|
25
25
|
|
26
26
|
content = content.raw_source
|
27
27
|
content = view_context.simple_format(content) if @email.sub_type == 'plain' || params[:part] == 'text'
|
28
|
+
content = prepare_inline_attachments(@email, content)
|
28
29
|
|
29
30
|
render html: content.html_safe, layout: false
|
30
31
|
end
|
@@ -79,5 +80,19 @@ module Maily
|
|
79
80
|
yield
|
80
81
|
end
|
81
82
|
end
|
83
|
+
|
84
|
+
def prepare_inline_attachments(email, content)
|
85
|
+
content.gsub(/src=(?:"cid:[^"]+"|'cid:[^']+')/i) do |match|
|
86
|
+
if part = find_part(email, match[9..-2])
|
87
|
+
%[src="data:#{part.mime_type};base64,#{Base64.encode64(part.body.raw_source)}"]
|
88
|
+
else
|
89
|
+
match
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
def find_part(email, cid)
|
95
|
+
email.all_parts.find { |p| p.attachment? && p.cid == cid }
|
96
|
+
end
|
82
97
|
end
|
83
98
|
end
|
data/lib/maily/generator.rb
CHANGED
data/lib/maily/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: maily
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- markets
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: '4.2'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: '4.2'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: sassc-rails
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|