From bb45af6c79dbdc84338ef7eaaef45f114a945942 Mon Sep 17 00:00:00 2001 From: Jaimyn Mayer Date: Fri, 22 Sep 2023 09:00:01 +1000 Subject: [PATCH] fix default email template name --- memberportal/services/emails.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/memberportal/services/emails.py b/memberportal/services/emails.py index 8b139482..dfd60ea4 100644 --- a/memberportal/services/emails.py +++ b/memberportal/services/emails.py @@ -8,19 +8,21 @@ def send_single_email( to_email: object, subject: object, template_vars: object, - template_name="email_without_button.html", + template_name, reply_to=None, user: object | None = None, ) -> object: # TODO: move to celery + template_to_use = template_name if template_name else "email_without_button.html" + if template_vars.get("message"): template_vars["message"] = escape(template_vars["message"]).replace( "~br~", "
" ) email_string = render_to_string( - template_name, {"email": template_vars, "config": config} + template_to_use, {"email": template_vars, "config": config} ) if config.POSTMARK_API_KEY: @@ -52,7 +54,7 @@ def send_single_email( def send_email_to_admin( subject: object, template_vars: object, - template_name="email_without_button.html", + template_name, reply_to=None, user: object | None = None, ) -> object: