[Erp5-report] r20969 - /erp5/trunk/products/ERP5/Document/EmailDocument.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Wed May 14 18:34:06 CEST 2008
Author: yusei
Date: Wed May 14 18:34:06 2008
New Revision: 20969
URL: http://svn.erp5.org?rev=20969&view=rev
Log:
Store entire mail message in data property when sending.
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=20969&r1=20968&r2=20969&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/EmailDocument.py (original)
+++ erp5/trunk/products/ERP5/Document/EmailDocument.py Wed May 14 18:34:06 2008
@@ -251,12 +251,15 @@
TODO: add support for legacy objects
"""
- if not self.hasFile():
+ if not self.hasFile() or self._baseGetTextContent() is not None:
# Return the standard text content if no file was provided
+ # Or standard text content is not empty.
if default is _MARKER:
return self._baseGetTextContent()
else:
return self._baseGetTextContent(default)
+
+ # find from mail message
text_result = None
html_result = None
for part in self._getMessage().walk():
@@ -405,6 +408,7 @@
#
# Build mail message
+ # This part will be replaced with MailTemplate soon.
#
if body is None:
body = self.asText()
@@ -501,6 +505,9 @@
mail_message = mime_message.as_string()
self.activate().sendMailHostMessage(mail_message)
+ # Save one of mail messages.
+ self.setData(mail_message)
+
# Only for debugging purpose
if download:
return mail_message
@@ -515,4 +522,3 @@
## Compatibility layer
#from Products.ERP5Type import Document
#Document.MailMessage = EmailDocument
-
More information about the Erp5-report
mailing list