Merge pull request #100 from keitaroinc/mailer-names-fix

Mailer names fix
This commit is contained in:
KirilPoposki98 2023-05-30 11:22:38 +02:00 committed by GitHub
commit f9ee4667df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,11 @@
--- ckan/ckan/lib/mailer.py
+++ ckan/ckan/lib/mailer.py
@@ -55,7 +55,7 @@ def _mail_recipient(recipient_name, recipient_email,
msg.add_header(k, v)
subject = Header(subject.encode('utf-8'), 'utf-8')
msg['Subject'] = subject
- msg['From'] = _("%s <%s>") % (sender_name, 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