premailer-rails 1.3.2 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b7fe7ad5147d3f2fc55adfb214b582cf36cb6e8d
4
- data.tar.gz: c89ed93ba60d97da47d9052a4021ec9464ca6f61
3
+ metadata.gz: 41073202cdcfc614302e4ebd78983e637bca0509
4
+ data.tar.gz: e6cffc67a632087c4403ae5ae3bc315f6949bcee
5
5
  SHA512:
6
- metadata.gz: 51cfbedc2689258c5bf481d573365b25c7116ebccdad4be79115d68e10515cfe5651c77e9d34fd31f70c5b0170f7e86b0b02c3fa5a887627be81157bf9c8f479
7
- data.tar.gz: f39cd91e3c94347be787f47a2aa6487a27c046d007981a164ad30d394924d0f64b38743bd708e2b5d56c3f14dce07de3bd5caefc06a4a3d41ec993fd0019bceb
6
+ metadata.gz: af6af666d40e0d924d3a8982fd240d407d9b5f01e8295d03c7aaa411285876ef23c03dc54aad10e0c4e0e28caa0c5132f7d0230c74edf0828e79664e1b30bf37
7
+ data.tar.gz: e1b3fa698a622be4fe6fd1bd18d9407dbac7823417fc0bf251adda5af9f096dec35fdbbca0f055dc5754fe7de763db3e541cfd84edbf0180d44a8d81012ffcbd
@@ -0,0 +1 @@
1
+ service_name: travis-ci
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
1
  *.gem
2
2
  doc/
3
3
  Gemfile.lock
4
+ coverage/
data/Gemfile CHANGED
@@ -1,6 +1,5 @@
1
- source "http://rubygems.org"
1
+ source "https://rubygems.org"
2
2
 
3
- # Specify your gem's dependencies in premailer-rails3.gemspec
4
3
  gemspec
5
4
 
6
5
  platforms :jruby do
data/README.md CHANGED
@@ -4,14 +4,12 @@
4
4
  [![Gem Version](https://badge.fury.io/rb/premailer-rails.png)](http://badge.fury.io/rb/premailer-rails)
5
5
  [![Dependency Status](https://gemnasium.com/fphilipe/premailer-rails.png)](https://gemnasium.com/fphilipe/premailer-rails)
6
6
  [![Code Climate](https://codeclimate.com/github/fphilipe/premailer-rails.png)](https://codeclimate.com/github/fphilipe/premailer-rails)
7
+ [![Coverage Status](https://coveralls.io/repos/fphilipe/premailer-rails/badge.png?branch=master)](https://coveralls.io/r/fphilipe/premailer-rails)
7
8
 
8
- This gem is a no config solution for the wonderful
9
- [Premailer gem](https://github.com/alexdunae/premailer) to be used with Rails.
10
- It uses interceptors which were introduced in Rails 3 and tweaks all mails which
11
- are `deliver`ed and adds a plain text part to them and inlines all CSS rules
12
- into the HTML part.
9
+ This gem is a no config solution for the wonderful [Premailer gem](https://github.com/alexdunae/premailer) to be used with Rails.
10
+ It uses interceptors which were introduced in Rails 3 and tweaks all mails which are `deliver`ed and adds a plain text part to them and inlines all CSS rules into the HTML part.
13
11
 
14
- By default it inlines all the CSS files that are linked to in the HTML:
12
+ By default it inlines all inline `<style>` declarations and all the CSS files that are linked to in the HTML:
15
13
 
16
14
  ```html
17
15
  <link type='text/css' ... />
@@ -19,7 +17,6 @@ By default it inlines all the CSS files that are linked to in the HTML:
19
17
 
20
18
  Don't worry about the host in the CSS URL since this will be ignored.
21
19
 
22
- Every CSS file is loaded from within the app.
23
20
  The retrieval of the file depends on your assets configuration:
24
21
 
25
22
  * Rails 3.1 asset pipeline: It will load the compiled version of the CSS asset
@@ -30,18 +27,13 @@ The retrieval of the file depends on your assets configuration:
30
27
  * Classic static assets: It will try to load the CSS file located in
31
28
  `public/stylesheets/`
32
29
 
33
- * [Hassle](https://github.com/pedro/hassle): It will try to load the
34
- compiled CSS file located in the default Hassle location
35
- `tmp/hassle/stylesheets/`
36
-
37
30
  ## Installation
38
31
 
39
32
  Simply add the gem to your Gemfile in your Rails project:
40
33
 
41
34
  gem 'premailer-rails'
42
35
 
43
- premailer-rails requires either nokogiri or hpricot. It doesn't list them as a
44
- dependency so you can choose which one to use.
36
+ premailer-rails requires either nokogiri or hpricot. It doesn't list them as a dependency so you can choose which one to use.
45
37
 
46
38
  gem 'nokogiri'
47
39
  # or
@@ -74,13 +66,10 @@ The default configs are:
74
66
  }
75
67
  ```
76
68
 
77
- The input encoding option [changed](https://github.com/alexdunae/premailer/commit/5f5cbb4ac181299a7e73d3eca11f3cf546585364)
78
- at some point. To make sure this option works regardless of the premailer
79
- version, the old and new setting is specified. If you want to use another
80
- encoding make sure to specify the right one or both.
69
+ The input encoding option [changed](https://github.com/alexdunae/premailer/commit/5f5cbb4ac181299a7e73d3eca11f3cf546585364) at some point.
70
+ To make sure this option works regardless of the premailer version, the old and new setting is specified.
71
+ If you want to use another encoding make sure to specify the right one or both.
81
72
 
82
- If you don't want to generate a text part from the html part, set the config
83
- `:generate_text_part` to false.
73
+ If you don't want to automatically generate a text part from the html part, set the config `:generate_text_part` to false.
84
74
 
85
- Note that the options `:with_html_string` and `:css_string` are used to make
86
- this gem work and will thus be overridden.
75
+ Note that the options `:with_html_string` and `:css_string` are used internally and thus will be overridden.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.3.2
1
+ 1.4.0
@@ -1,6 +1,7 @@
1
1
  require 'premailer'
2
2
  require 'action_mailer'
3
3
 
4
+ require 'premailer/rails/version'
4
5
  require 'premailer/rails/css_loaders'
5
6
  require 'premailer/rails/css_helper'
6
7
  require 'premailer/rails/customized_premailer'
@@ -29,10 +29,6 @@ class Premailer
29
29
  end
30
30
  end
31
31
 
32
- def has_inline_css?(doc)
33
- not doc.search('style[@type="text/css"]').empty?
34
- end
35
-
36
32
  def load_css(url)
37
33
  path = extract_path(url)
38
34
 
@@ -1,42 +1,115 @@
1
1
  class Premailer
2
2
  module Rails
3
3
  class Hook
4
+ attr_reader :message
5
+
4
6
  def self.delivering_email(message)
5
- # If the mail only has one part, it may be stored in message.body. In that
6
- # case, if the mail content type is text/html, the body part will be the
7
- # html body.
8
- if message.html_part
9
- html_body = message.html_part.body.to_s
10
- needs_multipart = true
11
- message.parts.delete(message.html_part)
12
- elsif message.content_type =~ /text\/html/
13
- html_body = message.body.to_s
14
- message.body = nil
15
- needs_multipart = Rails.config[:generate_text_part]
7
+ self.new(message).perform
8
+ end
9
+
10
+ def initialize(message)
11
+ @message = message
12
+ end
13
+
14
+ def perform
15
+ if message_contains_html?
16
+ replace_html_part(generate_html_part_replacement)
16
17
  end
17
18
 
18
- if html_body
19
- premailer = CustomizedPremailer.new(html_body)
20
- charset = message.charset
21
-
22
- if needs_multipart
23
- # IMPORTANT: Plain text part must be generated before CSS is inlined.
24
- # Not doing so results in CSS declarations visible in the plain text
25
- # part.
26
- if Rails.config[:generate_text_part] \
27
- and not message.text_part
28
- message.text_part do
29
- content_type "text/plain; charset=#{charset}"
30
- body premailer.to_plain_text
31
- end
32
- end
19
+ message
20
+ end
21
+
22
+ private
23
+
24
+ def message_contains_html?
25
+ html_part.present?
26
+ end
27
+
28
+ # Returns true if the message itself has a content type of text/html, thus
29
+ # it does not contain other parts such as alternatives and attachments.
30
+ def pure_html_message?
31
+ message.content_type.include?('text/html')
32
+ end
33
+
34
+ def generate_html_part_replacement
35
+ if generate_text_part?
36
+ generate_alternative_part
37
+ else
38
+ generate_html_part
39
+ end
40
+ end
41
+
42
+ def generate_text_part?
43
+ Rails.config[:generate_text_part] && !message.text_part
44
+ end
45
+
46
+ def generate_alternative_part
47
+ part = Mail::Part.new(:content_type => 'multipart/alternative')
48
+ part.add_part(generate_html_part)
49
+ part.add_part(generate_text_part)
50
+
51
+ part
52
+ end
53
+
54
+ def generate_html_part
55
+ # Make sure that the text part is generated first. Otherwise the text
56
+ # can end up containing CSS rules.
57
+ generate_text_part if generate_text_part?
58
+
59
+ Mail::Part.new(
60
+ :content_type => "text/html; charset=#{html_part.charset}",
61
+ :body => premailer.to_inline_css)
62
+ end
63
+
64
+ def generate_text_part
65
+ @text_part ||= Mail::Part.new(
66
+ :content_type => "text/plain; charset=#{html_part.charset}",
67
+ :body => premailer.to_plain_text)
68
+ end
69
+
70
+ def premailer
71
+ @premailer ||= CustomizedPremailer.new(html_part.body.to_s)
72
+ end
73
+
74
+ def html_part
75
+ if pure_html_message?
76
+ message
77
+ else
78
+ message.html_part
79
+ end
80
+ end
81
+
82
+ def replace_html_part(new_part)
83
+ if pure_html_message?
84
+ replace_in_pure_html_message(new_part)
85
+ else
86
+ replace_part_in_list(message.parts, html_part, new_part)
87
+ end
88
+ end
89
+
90
+ # If the new part is a pure text/html part, the body and its content type
91
+ # are used for the message. If the new part is
92
+ def replace_in_pure_html_message(new_part)
93
+ if new_part.content_type.include?('text/html')
94
+ message.body = new_part.body.to_s
95
+ message.content_type = new_part.content_type
96
+ else
97
+ message.body = nil
98
+ message.content_type = new_part.content_type
99
+ new_part.parts.each do |part|
100
+ message.add_part(part)
101
+ end
102
+ end
103
+ end
33
104
 
34
- message.html_part do
35
- content_type "text/html; charset=#{charset}"
36
- body premailer.to_inline_css
105
+ def replace_part_in_list(parts_list, old_part, new_part)
106
+ if (index = parts_list.index(old_part))
107
+ parts_list[index] = new_part
108
+ else
109
+ parts_list.any? do |part|
110
+ if part.respond_to?(:parts)
111
+ replace_part_in_list(part.parts, old_part, new_part)
37
112
  end
38
- else
39
- message.body = premailer.to_inline_css
40
113
  end
41
114
  end
42
115
  end
@@ -7,7 +7,9 @@ Premailer::Adapter::Nokogiri.module_eval do
7
7
  html = html.force_encoding('UTF-8').encode!
8
8
  ::Nokogiri::HTML(html) {|c| c.recover }
9
9
  else
10
+ # :nocov:
10
11
  ::Nokogiri::HTML(html, nil, 'UTF-8') {|c| c.recover }
12
+ # :nocov:
11
13
  end
12
14
  end
13
15
  end
@@ -29,4 +29,5 @@ Gem::Specification.new do |s|
29
29
  s.add_development_dependency 'mail'
30
30
  s.add_development_dependency 'nokogiri'
31
31
  s.add_development_dependency 'hpricot'
32
+ s.add_development_dependency 'coveralls'
32
33
  end
@@ -44,17 +44,39 @@ nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
44
44
  TEXT
45
45
 
46
46
  def with_parts(*part_types)
47
+ if part_types.count == 1 and [:html, :text].include?(part_types.first)
48
+ return with_body(part_types.first)
49
+ end
50
+
47
51
  message = base_message
52
+ content_part = message
53
+
54
+ if part_types.include?(:html) and part_types.include?(:text)
55
+ content_part = Mail::Part.new(:content_type => 'multipart/alternative')
56
+ message.add_part(content_part)
57
+ end
58
+
59
+ if part_types.include? :html
60
+ html_part = Mail::Part.new do
61
+ body HTML_PART_WITH_CSS
62
+ content_type 'text/html; charset=UTF-8'
63
+ end
64
+ content_part.html_part = html_part
65
+ end
48
66
 
49
- message.html_part do
50
- body HTML_PART
51
- content_type 'text/html; charset=UTF-8'
52
- end if part_types.include? :html
67
+ if part_types.include? :text
68
+ text_part = Mail::Part.new do
69
+ body TEXT_PART
70
+ content_type 'text/plain; charset=UTF-8'
71
+ end
72
+ content_part.text_part = text_part
73
+ end
53
74
 
54
- message.text_part do
55
- body TEXT_PART
56
- content_type 'text/plain; charset=UTF-8'
57
- end if part_types.include? :text
75
+ if part_types.include? :attachment
76
+ message.add_file(:filename => 'foo.png', :content => 'foobar')
77
+ end
78
+
79
+ message.ready_to_send!
58
80
 
59
81
  message
60
82
  end
@@ -64,13 +86,15 @@ nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
64
86
 
65
87
  case body_type
66
88
  when :html
67
- message.body = HTML_PART
89
+ message.body = HTML_PART_WITH_CSS
68
90
  message.content_type 'text/html; charset=UTF-8'
69
91
  when :text
70
92
  message.body = TEXT_PART
71
93
  message.content_type 'text/plain; charset=UTF-8'
72
94
  end
73
95
 
96
+ message.ready_to_send!
97
+
74
98
  message
75
99
  end
76
100
 
@@ -79,7 +103,7 @@ nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
79
103
  def base_message
80
104
  Mail.new do
81
105
  to 'some@email.com'
82
- subject 'testing premailer-rails3'
106
+ subject 'testing premailer-rails'
83
107
  end
84
108
  end
85
109
  end
@@ -5,6 +5,6 @@ describe 'ActionMailer::Base.register_interceptor' do
5
5
  ActionMailer::Base \
6
6
  .expects(:register_interceptor) \
7
7
  .with(Premailer::Rails::Hook)
8
- load 'premailer/rails3.rb'
8
+ load 'premailer/rails.rb'
9
9
  end
10
10
  end
@@ -1,105 +1,77 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Premailer::Rails::Hook do
4
- describe '.delivering_email' do
5
- before { File.stubs(:read).returns('') }
6
- def run_hook(message)
7
- Premailer::Rails::Hook.delivering_email(message)
8
- end
4
+ def run_hook(message)
5
+ Premailer::Rails::Hook.delivering_email(message)
6
+ end
9
7
 
10
- context 'when message contains html part' do
11
- let(:message) { Fixtures::Message.with_parts :html }
8
+ class Mail::Message
9
+ def html_string
10
+ (html_part || self).body.to_s
11
+ end
12
+ end
12
13
 
13
- it 'should create a text part from the html part' do
14
- Premailer::Rails::CustomizedPremailer \
15
- .any_instance.expects(:to_plain_text)
16
- run_hook(message)
17
- message.text_part.should be_a Mail::Part
18
- end
14
+ let(:message) { Fixtures::Message.with_body(:html) }
15
+ let(:processed_message) { run_hook(message) }
19
16
 
20
- it 'should inline the css in the html part' do
21
- Premailer::Rails::CustomizedPremailer \
22
- .any_instance.expects(:to_inline_css)
23
- run_hook(message)
24
- end
17
+ it 'inlines the CSS' do
18
+ expect { run_hook(message) }.to \
19
+ change { message.html_string.include?("<p style=") }
20
+ end
25
21
 
26
- it 'should not create a text part if disabled' do
27
- Premailer::Rails::CustomizedPremailer \
28
- .any_instance.expects(:to_plain_text).never
29
- Premailer::Rails.config[:generate_text_part] = false
30
- run_hook(message)
31
- Premailer::Rails.config[:generate_text_part] = true
32
- message.text_part.should be_nil
33
- message.html_part.should be_a Mail::Part
34
- end
22
+ it 'replaces the html part with an alternative part containing text and html parts' do
23
+ processed_message.content_type.should include 'multipart/alternative'
24
+ processed_message.parts.should =~ [message.html_part, message.text_part]
25
+ end
35
26
 
36
- it 'should not create an additional html part' do
37
- run_hook(message)
38
- message.parts.count { |i| i.content_type =~ /text\/html/ }.should == 1
39
- end
40
- end
27
+ it 'generates a text part from the html' do
28
+ expect { run_hook(message) }.to change(message, :text_part)
29
+ end
41
30
 
42
- context 'when message contains text part' do
43
- let(:message) { Fixtures::Message.with_parts :text }
31
+ context 'when message contains no html' do
32
+ let(:message) { Fixtures::Message.with_body(:text) }
44
33
 
45
- it 'should not modify the message' do
46
- Premailer.expects(:new).never
47
- run_hook(message)
48
- end
34
+ it 'does not modify the message' do
35
+ expect { run_hook(message) }.to_not change(message, :html_string)
49
36
  end
37
+ end
50
38
 
51
- context 'when message contains html and text part' do
52
- let(:message) { Fixtures::Message.with_parts :html, :text }
53
-
54
- it 'should not create a text part from the html part' do
55
- Premailer::Rails::CustomizedPremailer \
56
- .any_instance.expects(:to_plain_text).never
57
- run_hook(message)
58
- message.text_part.should be_a Mail::Part
59
- end
39
+ context 'when message also contains a text part' do
40
+ let(:message) { Fixtures::Message.with_parts(:html, :text) }
60
41
 
61
- it 'should inline the css in the html part' do
62
- Premailer::Rails::CustomizedPremailer \
63
- .any_instance.expects(:to_inline_css)
64
- run_hook(message)
65
- end
42
+ it 'does not generate a text part' do
43
+ expect { run_hook(message) }.to_not change(message, :text_part)
66
44
  end
67
45
 
68
- context 'when message contains html body' do
69
- let(:message) { Fixtures::Message.with_body :html }
70
-
71
- it 'should create a text part from the html part' do
72
- Premailer::Rails::CustomizedPremailer \
73
- .any_instance.expects(:to_plain_text)
74
- run_hook(message)
75
- end
76
-
77
- it 'should create a html part and inline the css' do
78
- Premailer::Rails::CustomizedPremailer \
79
- .any_instance.expects(:to_inline_css)
80
- run_hook(message)
81
- message.html_part.should be_a Mail::Part
82
- end
46
+ it 'does not replace any message part' do
47
+ expect { run_hook(message) }.to_not \
48
+ change { message.all_parts.map(&:content_type) }
49
+ end
50
+ end
83
51
 
84
- it 'should not create a text part if disabled' do
85
- Premailer::Rails::CustomizedPremailer \
86
- .any_instance.expects(:to_plain_text).never
52
+ context 'when text generation is disabled' do
53
+ it 'does not generate a text part' do
54
+ begin
87
55
  Premailer::Rails.config[:generate_text_part] = false
88
- run_hook(message)
56
+
57
+ expect { run_hook(message) }.to_not change(message, :text_part)
58
+ ensure
89
59
  Premailer::Rails.config[:generate_text_part] = true
90
- message.text_part.should be_nil
91
- message.html_part.should be_nil
92
- message.body.should_not be_empty
93
60
  end
94
61
  end
62
+ end
95
63
 
96
- context 'when message contains text body' do
97
- let(:message) { Fixtures::Message.with_body :text }
98
-
99
- it 'should not modify the message' do
100
- Premailer.expects(:new).never
101
- run_hook(message)
102
- end
64
+ context 'when message also contains an attachment' do
65
+ let(:message) { Fixtures::Message.with_parts(:html, :attachment) }
66
+ it 'does not mess with it' do
67
+ message.content_type.should include 'multipart/mixed'
68
+ message.parts.first.content_type.should include 'text/html'
69
+ message.parts.last.content_type.should include 'image/png'
70
+
71
+ processed_message.content_type.should include 'multipart/mixed'
72
+ processed_message.parts.first.content_type.should \
73
+ include 'multipart/alternative'
74
+ processed_message.parts.last.content_type.should include 'image/png'
103
75
  end
104
76
  end
105
77
  end
@@ -1,3 +1,10 @@
1
+ if RUBY_VERSION >= '1.9'
2
+ require 'coveralls'
3
+ Coveralls.wear! do
4
+ add_filter 'spec/'
5
+ end
6
+ end
7
+
1
8
  require 'premailer/rails'
2
9
 
3
10
  require 'stubs/action_mailer'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: premailer-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Philipe Fatio
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-03-12 00:00:00.000000000 Z
11
+ date: 2013-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: premailer
@@ -122,6 +122,20 @@ dependencies:
122
122
  - - '>='
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: coveralls
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - '>='
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - '>='
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
125
139
  description: |-
126
140
  This gem brings you the power of the premailer gem to Rails
127
141
  without any configuration needs. Create HTML emails,
@@ -133,6 +147,7 @@ executables: []
133
147
  extensions: []
134
148
  extra_rdoc_files: []
135
149
  files:
150
+ - .coveralls.yml
136
151
  - .gitignore
137
152
  - .rspec
138
153
  - .travis.yml
@@ -148,9 +163,7 @@ files:
148
163
  - lib/premailer/rails/customized_premailer.rb
149
164
  - lib/premailer/rails/hook.rb
150
165
  - lib/premailer/rails/nokogiri_fix.rb
151
- - lib/premailer/rails/premailer.rb
152
166
  - lib/premailer/rails/version.rb
153
- - lib/premailer/rails3.rb
154
167
  - premailer-rails.gemspec
155
168
  - spec/fixtures/html.rb
156
169
  - spec/fixtures/message.rb
@@ -1,20 +0,0 @@
1
- class Premailer
2
- module Rails
3
- class CustomizedPremailer < ::Premailer
4
- def initialize(html)
5
- # In order to pass the CSS as string to super it is necessary to access
6
- # the parsed HTML beforehand. To do so, the adapter needs to be
7
- # initialized. The ::Premailer::Adaptor handles the discovery of a
8
- # suitable adaptor (Nokogiri or Hpricot). To make load_html work, an
9
- # adaptor needs to be included and @options[:with_html_string] needs to
10
- # be set. For further information, refer to ::Premailer#initialize.
11
- @options = Rails.config.merge(:with_html_string => true)
12
- Premailer.send(:include, Adapter.find(Adapter.use))
13
- doc = load_html(html)
14
-
15
- options = @options.merge(:css_string => CSSHelper.css_for_doc(doc))
16
- super(html, options)
17
- end
18
- end
19
- end
20
- end
@@ -1,23 +0,0 @@
1
- require 'premailer'
2
- require 'action_mailer'
3
-
4
- require 'premailer/rails/css_loaders'
5
- require 'premailer/rails/css_helper'
6
- require 'premailer/rails/customized_premailer'
7
- require 'premailer/rails/hook'
8
- require 'premailer/rails/nokogiri_fix'
9
-
10
- class Premailer
11
- module Rails
12
- @config = {
13
- :input_encoding => 'UTF-8',
14
- :inputencoding => 'UTF-8',
15
- :generate_text_part => true
16
- }
17
- class << self
18
- attr_accessor :config
19
- end
20
- end
21
- end
22
-
23
- ActionMailer::Base.register_interceptor(Premailer::Rails::Hook)