fix send_mail

This commit is contained in:
Cayo Puigdefabregas 2023-11-16 14:30:19 +01:00
parent 4120d0230b
commit 366522938f
1 changed files with 8 additions and 5 deletions

View File

@ -47,9 +47,12 @@ class NotifyActivateUserByEmail:
subject, body, from_email, [to_email])
html_email = loader.render_to_string(html_email_template_name, context)
email_message.attach_alternative(html_email, 'text/html')
try:
if settings.DEVELOPMENT:
print(to_email)
print(body)
return
email_message.send()
except Exception:
return