Commit 2e4b0361 authored by Michal Čihař's avatar Michal Čihař

Share code for sending mails

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent cd7d062b
......@@ -337,14 +337,11 @@ def send_notification_email(language, email, notification,
'''
Renders and sends notification email.
'''
try:
email = get_notification_email(
language, email, notification, translation_obj, context, headers,
user, info
)
email.send(fail_silently=False)
except SMTPException as error:
weblate.logger.error('Failed to send email: %s', error)
email = get_notification_email(
language, email, notification, translation_obj, context, headers,
user, info
)
send_mails([email])
class VerifiedEmail(models.Model):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment