FIX: during concurrent emails generation renderer should not be reused

Our instance used for template rendering needs a lock to ensure there is
no race condition where rendering happens on 2 threads at the same time.

This can lead to local poisoning which can cause unexpected results in
emails
This commit is contained in:
Sam Saffron
2019-10-10 08:50:48 +11:00
parent 04452e748d
commit 5aaf7e3316
4 changed files with 13 additions and 7 deletions

View File

@ -94,7 +94,7 @@ module Email
html_override.gsub!("%{respond_instructions}", "")
end
html = UserNotificationRenderer.instance.render(
html = UserNotificationRenderer.render(
template: 'layouts/email_template',
format: :html,
locals: { html_body: html_override.html_safe }