fix: Rendering of email templates needs access to settings
(#4163)
Since #4104.
This commit is contained in:
parent
0ba50999d9
commit
34b78aff94
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue