Don't apply styling unless the HTML template is active
This commit is contained in:
parent
1b5ec42173
commit
1056b94b56
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue