Skip to content

Commit

Permalink
Merge pull request #88 from noirbee/bug_from_email_format
Browse files Browse the repository at this point in the history
Support the "name <[email protected]>" form for DEFAULT_FROM_EMAIL
  • Loading branch information
bennylope committed Jan 14, 2016
2 parents e837ce1 + 94e9cb2 commit 5e7f7ab
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion organizations/backends/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"""Backend classes should provide common interface
"""

import email.utils
import uuid

from django.conf import settings
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 5e7f7ab

Please sign in to comment.