Don't apply styling unless the HTML template is active

This commit is contained in:
Robin Ward 2013-06-07 12:39:35 -04:00
parent 1b5ec42173
commit 1056b94b56
1 changed files with 3 additions and 3 deletions

View File

@ -20,16 +20,16 @@ class EmailRenderer
end end
def html def html
formatted_body = EmailStyles.new(PrettyText.cook(text, environment: 'email')).format cooked = PrettyText.cook(text, environment: 'email')
if @opts[:html_template] if @opts[:html_template]
ActionView::Base.new(Rails.configuration.paths["app/views"]).render( ActionView::Base.new(Rails.configuration.paths["app/views"]).render(
template: 'email/template', template: 'email/template',
format: :html, format: :html,
locals: { html_body: formatted_body, logo_url: logo_url } locals: { html_body: EmailStyles.new(cooked).format, logo_url: logo_url }
) )
else else
formatted_body cooked
end end
end end