Class: ActiveMail::Inliner::Premailer

Inherits:
Base
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/activemail/inliner/premailer.rb

Instance Method Summary collapse

Methods inherited from Base

#noop?

Instance Method Details

#inline(html) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/activemail/inliner/premailer.rb', line 12

def inline(html)
  # premailer is a hard runtime dependency (the default inliner), so require
  # can't fail — unlike the optional Roadie adapter, which guards LoadError.
  require 'premailer'
  # warn_level NONE: premailer's un-inlinable-CSS warnings are noise at delivery
  # time; the quality layer is where coverage gaps should surface.
  ::Premailer.new(html, with_html_string: true, warn_level: ::Premailer::Warnings::NONE).to_inline_css
end