From 94e9cb26678dc0a461d872e5b80a4d7ec7410796 Mon Sep 17 00:00:00 2001 From: Nicolas Noirbent Date: Thu, 14 Jan 2016 18:17:42 +0100 Subject: [PATCH] Support the "name " form for DEFAULT_FROM_EMAIL in registration/invitation backends --- organizations/backends/defaults.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/organizations/backends/defaults.py b/organizations/backends/defaults.py index 1d4daa92..a6ada674 100644 --- a/organizations/backends/defaults.py +++ b/organizations/backends/defaults.py @@ -26,6 +26,7 @@ """Backend classes should provide common interface """ +import email.utils import uuid from django.conf import settings @@ -140,7 +141,7 @@ def _send_email(self, user, subject_template, body_template, """Utility method for sending emails to new users""" if sender: from_email = "%s %s <%s>" % (sender.first_name, sender.last_name, - settings.DEFAULT_FROM_EMAIL) + email.utils.parseaddr(settings.DEFAULT_FROM_EMAIL)[1]) reply_to = "%s %s <%s>" % (sender.first_name, sender.last_name, sender.email) else: