Fixes tests

This commit is contained in:
Mouse Reeve
2021-03-21 09:20:37 -07:00
parent 4575fe24c7
commit 33b5639af0
3 changed files with 17 additions and 12 deletions

View File

@ -29,15 +29,19 @@ def password_reset_email(reset_code):
@app.task
def send_email(recipient, message_name, data):
""" use a task to send the email """
subject = get_template(
"email/{}/subject.html".format(message_name)
).render(data).strip()
html_content = get_template(
"email/{}/html_content.html".format(message_name)
).render(data).strip()
text_content = get_template(
"email/{}/text_content.html".format(message_name)
).render(data).strip()
subject = (
get_template("email/{}/subject.html".format(message_name)).render(data).strip()
)
html_content = (
get_template("email/{}/html_content.html".format(message_name))
.render(data)
.strip()
)
text_content = (
get_template("email/{}/text_content.html".format(message_name))
.render(data)
.strip()
)
email = EmailMultiAlternatives(subject, text_content, None, [recipient])
email.attach_alternative(html_content, "text/html")