Commit e963abcf authored by Jérome Perrin's avatar Jérome Perrin

include the person's name with the email address


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19438 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1c1710dd
...@@ -418,7 +418,12 @@ class EmailDocument(File, TextDocument): ...@@ -418,7 +418,12 @@ class EmailDocument(File, TextDocument):
if subject is None: if subject is None:
subject = self.getTitle() subject = self.getTitle()
if from_url is None: if from_url is None:
from_url = self.getSourceValue().getDefaultEmailText() sender = self.getSourceValue()
if sender.getTitle():
from_url = '"%s" <%s>' % (sender.getTitle(),
sender.getDefaultEmailText())
else:
from_url = sender.getDefaultEmailText()
if reply_url is None: if reply_url is None:
reply_url = self.portal_preferences.getPreferredEventSenderEmail() reply_url = self.portal_preferences.getPreferredEventSenderEmail()
if to_url is None: if to_url is None:
...@@ -426,7 +431,10 @@ class EmailDocument(File, TextDocument): ...@@ -426,7 +431,10 @@ class EmailDocument(File, TextDocument):
for recipient in self.getDestinationValueList(): for recipient in self.getDestinationValueList():
email = recipient.getDefaultEmailText() email = recipient.getDefaultEmailText()
if email: if email:
to_url.append(email) if recipient.getTitle():
to_url.append('"%s" <%s>' % (recipient.getTitle(), email))
else:
to_url.append(email)
else: else:
raise ValueError, 'Recipient %s has no defined email' % recipient raise ValueError, 'Recipient %s has no defined email' % recipient
elif type(to_url) in types.StringTypes: elif type(to_url) in types.StringTypes:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment