send_by_email: add another way to get current user email address (#4326)
This commit is contained in:
parent
1e0328bb78
commit
2a813ff5bf
|
@ -64,7 +64,13 @@ class MailForm(form.AddForm):
|
|||
msg = MIMEMultipart()
|
||||
msg['Subject'] = subject
|
||||
msg['To'] = ', '.join(recipients)
|
||||
msg['From'] = api.user.get_current().email or \
|
||||
|
||||
ldap_email = api.user.get_current().getProperty('email')
|
||||
if not isinstance(ldap_email, str):
|
||||
ldap_email = None
|
||||
|
||||
msg['From'] = api.user.get_current().getProperty('email', None) or \
|
||||
api.user.get_current().email or \
|
||||
api.portal.get().getProperty('email_from_address') or \
|
||||
'admin@localhost'
|
||||
|
||||
|
|
Reference in New Issue