From 60e8a361e92208a8e9100eca7c09a42da16a6aab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Tue, 14 Aug 2018 10:56:29 +0200 Subject: [PATCH] misc: pass request when rendering email subject and text/plain part (#25683) --- src/authentic2/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/authentic2/utils.py b/src/authentic2/utils.py index 6660da9d..d32a5a67 100644 --- a/src/authentic2/utils.py +++ b/src/authentic2/utils.py @@ -596,11 +596,11 @@ def send_templated_mail(user_or_email, template_names, context=None, with_html=T subject_template_names = [template_name + '_subject.txt' for template_name in template_names] subject_template_names += legacy_subject_templates or [] - subject = render_to_string(subject_template_names, ctx).strip() + subject = render_to_string(subject_template_names, ctx, request=request).strip() body_template_names = [template_name + '_body.txt' for template_name in template_names] body_template_names += legacy_body_templates or [] - body = render_to_string(body_template_names, ctx) + body = render_to_string(body_template_names, ctx, request=request) html_body = None html_body_template_names = [template_name + '_body.html' for template_name in template_names] -- 2.18.0