diff --git a/app/helpers/email_helper.rb b/app/helpers/email_helper.rb index 14364d45c32..a1373329b8e 100644 --- a/app/helpers/email_helper.rb +++ b/app/helpers/email_helper.rb @@ -26,7 +26,7 @@ module EmailHelper end def email_html_template - EmailStyle.new.html.sub('%{email_content}', yield).html_safe + EmailStyle.new.html.sub('%{email_content}', capture { yield }).html_safe end protected diff --git a/spec/integration/email_style_spec.rb b/spec/integration/email_style_spec.rb index 395dd19df15..42203ecdfe2 100644 --- a/spec/integration/email_style_spec.rb +++ b/spec/integration/email_style_spec.rb @@ -6,9 +6,10 @@ describe EmailStyle do context "ERB evaluation" do it "does not evaluate ERB outside of the email itself" do - SiteSetting.email_custom_template = "