Skip to content

Commit

Permalink
fix: Rendering of email templates needs access to settings (#4163)
Browse files Browse the repository at this point in the history
Since #4104.
  • Loading branch information
larseggert authored Jul 6, 2022
1 parent 0ba5099 commit 34b78af
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ietf/utils/mail.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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


0 comments on commit 34b78af

Please sign in to comment.