Email sender recipient fix

This commit is contained in:
blagoja 2023-05-02 11:36:26 +02:00
parent 9fa00a9a24
commit 5c9c5920b4
2 changed files with 12 additions and 1 deletions

View File

@ -5,7 +5,7 @@
subject = Header(subject.encode('utf-8'), 'utf-8')
msg['Subject'] = subject
- msg['From'] = _("%s <%s>") % (sender_name, mail_from)
+ msg['From'] = _("%s <%s>") % ('CKAN', mail_from)
+ msg['From'] = utils.formataddr((sender_name, mail_from))
msg['To'] = u"%s <%s>" % (recipient_name, recipient_email)
msg['Date'] = utils.formatdate(time())
msg['X-Mailer'] = "CKAN %s" % ckan.__version__

View File

@ -0,0 +1,11 @@
--- ckan/ckan/lib/mailer.py
+++ ckan/ckan/lib/mailer.py
@@ -56,7 +56,7 @@ def _mail_recipient(recipient_name, recipient_email,
subject = Header(subject.encode('utf-8'), 'utf-8')
msg['Subject'] = subject
msg['From'] = utils.formataddr((sender_name, mail_from))
- msg['To'] = u"%s <%s>" % (recipient_name, recipient_email)
+ msg['To'] = utils.formataddr((recipient_name, recipient_email))
msg['Date'] = utils.formatdate(time())
msg['X-Mailer'] = "CKAN %s" % ckan.__version__
# Check if extension is setting reply-to via headers or use config option