Sha256: 837f67a297954511dde27e957d62c0731b18a60665982d839d1da1ef6b286ceb
Contents?: true
Size: 811 Bytes
Versions: 17
Compression:
Stored size: 811 Bytes
Contents
module GhostInThePost class MailGhost attr_reader :email, :included_scripts, :timeout, :wait_event def initialize(email, timeout=nil, wait_event=nil, included_scripts=[]) @email = email @timeout = timeout @wait_event = wait_event @included_scripts = Array(included_scripts).compact end def execute improve_body if email.content_type =~ /^text\/html/ improve_html_part(email.html_part) if email.html_part email end private def improve_body email.body = ghost_html(email.body.decoded) end def improve_html_part(html_part) html_part.body = ghost_html(html_part.body.decoded) end def ghost_html(old_html) PhantomTransform.new(old_html, timeout, wait_event, included_scripts).transform end end end
Version data entries
17 entries across 17 versions & 1 rubygems