actionmailer 4.1.11 → 4.1.12.rc1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of actionmailer might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +19 -0
- data/lib/action_mailer.rb +1 -0
- data/lib/action_mailer/base.rb +1 -0
- data/lib/action_mailer/gem_version.rb +2 -2
- data/lib/action_mailer/inline_preview_interceptor.rb +61 -0
- metadata +9 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e024105b8752861f2d87e2aa0e463696f57d7382
|
4
|
+
data.tar.gz: cc9209a06c0b79c7a17d130823cacbc5909f9213
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 642b24fcb08493533d566d97fb890c89ddb8c4bbaecc5dd6492824472fcfa05ccd5069f0b355a699a1c4da8dc6bb0bb6bf6dfdb8f77b109f35cb05c2b91230c9
|
7
|
+
data.tar.gz: e561a910d0d51c68a4ec1eaeb57e04eb273bd5fbf12c1e72350cb6c01a629f7e08c6bcca24cdb5c74c57a8456cd40595b2ff0c73183eb28457699eff5428e8d0
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,22 @@
|
|
1
|
+
## Rails 4.1.12 (June 22, 2015) ##
|
2
|
+
|
3
|
+
* Mailer preview now uses `url_for` to fix links to emails for apps running on
|
4
|
+
a subdirectory.
|
5
|
+
|
6
|
+
*Remo Mueller*
|
7
|
+
|
8
|
+
* Mailer previews no longer crash when the `mail` method wasn't called
|
9
|
+
(`NullMail`).
|
10
|
+
|
11
|
+
Fixes #19849.
|
12
|
+
|
13
|
+
*Yves Senn*
|
14
|
+
|
15
|
+
* Make sure labels and values line up in mailer previews.
|
16
|
+
|
17
|
+
*Yves Senn*
|
18
|
+
|
19
|
+
|
1
20
|
## Rails 4.1.11 (June 16, 2015) ##
|
2
21
|
|
3
22
|
* No changes.
|
data/lib/action_mailer.rb
CHANGED
data/lib/action_mailer/base.rb
CHANGED
@@ -0,0 +1,61 @@
|
|
1
|
+
require 'base64'
|
2
|
+
|
3
|
+
module ActionMailer
|
4
|
+
# Implements a mailer preview interceptor that converts image tag src attributes
|
5
|
+
# that use inline cid: style urls to data: style urls so that they are visible
|
6
|
+
# when previewing a HTML email in a web browser.
|
7
|
+
#
|
8
|
+
# This interceptor is not enabled by default, to use it just register it like any
|
9
|
+
# other mailer preview interceptor:
|
10
|
+
#
|
11
|
+
# ActionMailer::Base.register_preview_interceptor(ActionMailer::InlinePreviewInterceptor)
|
12
|
+
#
|
13
|
+
class InlinePreviewInterceptor
|
14
|
+
PATTERN = /src=(?:"cid:[^"]+"|'cid:[^']+')/i
|
15
|
+
|
16
|
+
include Base64
|
17
|
+
|
18
|
+
def self.previewing_email(message) #:nodoc:
|
19
|
+
new(message).transform!
|
20
|
+
end
|
21
|
+
|
22
|
+
def initialize(message) #:nodoc:
|
23
|
+
@message = message
|
24
|
+
end
|
25
|
+
|
26
|
+
def transform! #:nodoc:
|
27
|
+
return message if html_part.blank?
|
28
|
+
|
29
|
+
html_source.gsub!(PATTERN) do |match|
|
30
|
+
if part = find_part(match[9..-2])
|
31
|
+
%[src="#{data_url(part)}"]
|
32
|
+
else
|
33
|
+
match
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
message
|
38
|
+
end
|
39
|
+
|
40
|
+
private
|
41
|
+
def message
|
42
|
+
@message
|
43
|
+
end
|
44
|
+
|
45
|
+
def html_part
|
46
|
+
@html_part ||= message.html_part
|
47
|
+
end
|
48
|
+
|
49
|
+
def html_source
|
50
|
+
html_part.body.raw_source
|
51
|
+
end
|
52
|
+
|
53
|
+
def data_url(part)
|
54
|
+
"data:#{part.mime_type};base64,#{strict_encode64(part.body.raw_source)}"
|
55
|
+
end
|
56
|
+
|
57
|
+
def find_part(cid)
|
58
|
+
message.all_parts.find{ |p| p.attachment? && p.cid == cid }
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: actionmailer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.1.
|
4
|
+
version: 4.1.12.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 4.1.
|
19
|
+
version: 4.1.12.rc1
|
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: 4.1.
|
26
|
+
version: 4.1.12.rc1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: actionview
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 4.1.
|
33
|
+
version: 4.1.12.rc1
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 4.1.
|
40
|
+
version: 4.1.12.rc1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: mail
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -73,6 +73,7 @@ files:
|
|
73
73
|
- lib/action_mailer/collector.rb
|
74
74
|
- lib/action_mailer/delivery_methods.rb
|
75
75
|
- lib/action_mailer/gem_version.rb
|
76
|
+
- lib/action_mailer/inline_preview_interceptor.rb
|
76
77
|
- lib/action_mailer/log_subscriber.rb
|
77
78
|
- lib/action_mailer/mail_helper.rb
|
78
79
|
- lib/action_mailer/preview.rb
|
@@ -98,9 +99,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
98
99
|
version: 1.9.3
|
99
100
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
100
101
|
requirements:
|
101
|
-
- - "
|
102
|
+
- - ">"
|
102
103
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
104
|
+
version: 1.3.1
|
104
105
|
requirements:
|
105
106
|
- none
|
106
107
|
rubyforge_project:
|