changeset 38abefa3d955 in trytond:default
details: https://hg.tryton.org/trytond?cmd=changeset;node=38abefa3d955
description:
Allow distinct FROM addresses for envelope and header
issue9948
review324741004
diffstat:
trytond/res/user.py | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diffs (24 lines):
diff -r d27b905106dd -r 38abefa3d955 trytond/res/user.py
--- a/trytond/res/user.py Mon Jan 25 22:56:02 2021 +0100
+++ b/trytond/res/user.py Wed Feb 03 23:26:07 2021 +0100
@@ -79,17 +79,16 @@
def _send_email(from_, users, email_func):
- if from_ is None:
- from_ = config.get('email', 'from')
+ from_cfg = config.get('email', 'from')
for user in users:
if not user.email:
logger.info("Missing address for '%s' to send email", user.login)
continue
msg, title = email_func(user)
- msg['From'] = from_
+ msg['From'] = from_ or from_cfg
msg['To'] = user.email
msg['Subject'] = Header(title, 'utf-8')
- sendmail_transactional(from_, [user.email], msg)
+ sendmail_transactional(from_cfg, [user.email], msg)
class PasswordError(UserError):