6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/action_mailer/inline_css_hook.rb', line 6
def self.delivering_email(message)
if html_part = (message.html_part || (message.content_type =~ /text\/html/ && message))
premailer = Premailer.new(html_part.body.to_s, :with_html_string => true)
existing_text_part = message.text_part && message.text_part.body.to_s
message.body = nil
message.html_part do
content_type "text/html; charset=utf-8"
body premailer.to_inline_css
end
message.text_part do
body existing_text_part || premailer.to_plain_text
end
end
end
|