From ec537e5ea203bd9a819098b5f70ebdb839cff6f3 Mon Sep 17 00:00:00 2001 From: Kane York Date: Mon, 5 Jul 2021 13:40:52 -0700 Subject: [PATCH] FIX: Do not interpret backreferences in email content This changes from providing a string literal for the #sub replacement, to providing a block. Because the block is provided the match object, it is presumed to have already performed all necessary backreferences. This avoids any replacement of backreferences in the message body. --- app/helpers/email_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/email_helper.rb b/app/helpers/email_helper.rb index 55b824ded30..f738ac49737 100644 --- a/app/helpers/email_helper.rb +++ b/app/helpers/email_helper.rb @@ -27,7 +27,7 @@ module EmailHelper def email_html_template EmailStyle.new.html - .sub('%{email_content}', capture { yield }) + .sub('%{email_content}') { capture { yield } } .gsub('%{html_lang}', html_lang) .html_safe end