Commit d59c7bb778349328268a59e8c563213e6282ba91
1 parent
9b9fba4e
Exists in
master
and in
1 other branch
Replaced premailer initializer with my actionmailer_inline_css gem.
Showing
4 changed files
with
7 additions
and
21 deletions
Show diff stats
Gemfile
| ... | ... | @@ -16,7 +16,7 @@ gem 'octokit' |
| 16 | 16 | gem 'inherited_resources' |
| 17 | 17 | gem 'SystemTimer', :platform => :ruby_18 |
| 18 | 18 | gem 'hoptoad_notifier', "~> 2.4" |
| 19 | -gem 'premailer' | |
| 19 | +gem 'actionmailer_inline_css', ">= 1.0.0" | |
| 20 | 20 | |
| 21 | 21 | platform :ruby do |
| 22 | 22 | gem 'bson_ext', '~> 1.3.1' | ... | ... |
Gemfile.lock
| ... | ... | @@ -13,6 +13,10 @@ GEM |
| 13 | 13 | actionmailer (3.0.5) |
| 14 | 14 | actionpack (= 3.0.5) |
| 15 | 15 | mail (~> 2.2.15) |
| 16 | + actionmailer_inline_css (1.0.0) | |
| 17 | + actionmailer (>= 3.0.0) | |
| 18 | + nokogiri (>= 1.4.4) | |
| 19 | + premailer (>= 1.7.1) | |
| 16 | 20 | actionpack (3.0.5) |
| 17 | 21 | activemodel (= 3.0.5) |
| 18 | 22 | activesupport (= 3.0.5) |
| ... | ... | @@ -206,6 +210,7 @@ PLATFORMS |
| 206 | 210 | |
| 207 | 211 | DEPENDENCIES |
| 208 | 212 | SystemTimer |
| 213 | + actionmailer_inline_css (>= 1.0.0) | |
| 209 | 214 | bson_ext (~> 1.3.1) |
| 210 | 215 | database_cleaner (~> 0.6.0) |
| 211 | 216 | devise (~> 1.4.0) |
| ... | ... | @@ -220,7 +225,6 @@ DEPENDENCIES |
| 220 | 225 | nokogiri |
| 221 | 226 | octokit |
| 222 | 227 | pivotal-tracker |
| 223 | - premailer | |
| 224 | 228 | rails (= 3.0.5) |
| 225 | 229 | redmine_client! |
| 226 | 230 | rspec (~> 2.5) | ... | ... |
app/views/layouts/mailer.html.haml
config/initializers/actionmailer_inline_css.rb
| ... | ... | @@ -1,18 +0,0 @@ |
| 1 | -# | |
| 2 | -# ActionMailer module for inline css in html emails | |
| 3 | -# | |
| 4 | -module ActionMailer::InlineCss | |
| 5 | - def render(*args) | |
| 6 | - if (template = args.first[:template]) && template.mime_type.html? | |
| 7 | - premailer = Premailer.new(super, :with_html_string => true, | |
| 8 | - :css => default_params[:css] || | |
| 9 | - ["#{Rails.root}/public/stylesheets/mailers/#{mailer_name}.css"]) | |
| 10 | - premailer.to_inline_css | |
| 11 | - else | |
| 12 | - super | |
| 13 | - end | |
| 14 | - end | |
| 15 | -end | |
| 16 | - | |
| 17 | -ActionMailer::Base.send :include, ActionMailer::InlineCss | |
| 18 | - |