Skip to content

Commit

Permalink
quote user display name for email name-addr format (#1171)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeriox authored Jan 4, 2024
1 parent 15204d4 commit 72768f3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ephios/core/services/notifications/backends.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import logging
import smtplib
import traceback
from email.utils import formataddr

from django.conf import settings
from django.core.mail import mail_admins
Expand Down Expand Up @@ -94,7 +95,7 @@ def can_send(cls, notification):
@classmethod
def _get_mailaddress(cls, notification):
if notification.user:
return f"{notification.user.get_full_name()} <{notification.user.email}>"
return formataddr((notification.user.get_full_name(), notification.user.email))
return notification.data.get("email")

@classmethod
Expand Down

0 comments on commit 72768f3

Please sign in to comment.