Skip to content

Commit

Permalink
fix default email template name
Browse files Browse the repository at this point in the history
  • Loading branch information
jabelone committed Sep 21, 2023
1 parent e113157 commit bb45af6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions memberportal/services/emails.py
Original file line number Diff line number Diff line change
Expand Up @@ -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~", "<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:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit bb45af6

Please sign in to comment.