fix(turbo): use a safer render method

This commit is contained in:
Paul Chavard 2022-04-19 09:39:24 +02:00
parent 55d6b787c8
commit 4624fa141f

View file

@ -33,7 +33,7 @@ module MailTemplateConcern
module ClassMethods
def default_for_procedure(procedure)
template_name = default_template_name_for_procedure(procedure)
rich_body = ActionController::Base.new.render_to_string(template: template_name)
rich_body = ActionController::Base.render template: template_name
trix_rich_body = rich_body.gsub(/(?<!^|[.-])(?<!<\/strong>)\n/, '')
new(subject: const_get(:DEFAULT_SUBJECT), rich_body: trix_rich_body, procedure: procedure)
end