[Erp5-report] r19438 - /erp5/trunk/products/ERP5/Document/EmailDocument.py

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Feb 20 16:24:36 CET 2008


Author: jerome
Date: Wed Feb 20 16:24:35 2008
New Revision: 19438

URL: http://svn.erp5.org?rev=19438&view=rev
Log:
include the person's name with the email address

Modified:
    erp5/trunk/products/ERP5/Document/EmailDocument.py

Modified: erp5/trunk/products/ERP5/Document/EmailDocument.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/EmailDocument.py?rev=19438&r1=19437&r2=19438&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/EmailDocument.py (original)
+++ erp5/trunk/products/ERP5/Document/EmailDocument.py Wed Feb 20 16:24:35 2008
@@ -418,7 +418,12 @@
     if subject is None:
       subject = self.getTitle()
     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:
       reply_url = self.portal_preferences.getPreferredEventSenderEmail()
     if to_url is None:
@@ -426,7 +431,10 @@
       for recipient in self.getDestinationValueList():
         email = recipient.getDefaultEmailText()
         if email:
-          to_url.append(email)
+          if recipient.getTitle():
+            to_url.append('"%s" <%s>' % (recipient.getTitle(), email))
+          else:
+            to_url.append(email)
         else:
           raise ValueError, 'Recipient %s has no defined email' % recipient
     elif type(to_url) in types.StringTypes:




More information about the Erp5-report mailing list