fix: Rendering of email templates needs access to settings ()

Since .
This commit is contained in:
Lars Eggert 2022-07-06 22:07:17 +03:00 committed by GitHub
parent 0ba50999d9
commit 34b78aff94
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -183,6 +183,7 @@ def send_mail(request, to, frm, subject, template, context, *args, **kwargs):
The body is a text/plain rendering of the template with the context.
extra is a dict of extra headers to add.
'''
context["settings"] = settings
txt = render_to_string(template, context, request=request)
return send_mail_text(request, to, frm, subject, txt, *args, **kwargs)
@ -628,4 +629,4 @@ def get_payload_text(msg, decode=True, default_charset="utf-8"):
payload = msg.get_payload(decode=decode)
payload = payload.decode(str(charset))
return payload