[Erp5-report] r21225 - in /erp5/trunk/bt5/erp5_crm: SkinTemplateItem/portal_skins/erp5_crm/...

nobody at svn.erp5.org nobody at svn.erp5.org
Thu May 29 17:11:11 CEST 2008


Author: yusei
Date: Thu May 29 17:11:09 2008
New Revision: 21225

URL: http://svn.erp5.org?rev=21225&view=rev
Log:
2008-5-29 yusei
* Add a minimum support of html mail.

Added:
    erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_viewHtmlMimeMessage.xml
Modified:
    erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_send.xml
    erp5/trunk/bt5/erp5_crm/bt/change_log
    erp5/trunk/bt5/erp5_crm/bt/revision

Modified: erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_send.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_send.xml?rev=21225&r1=21224&r2=21225&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_send.xml (original)
+++ erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_send.xml Thu May 29 17:11:09 2008
@@ -73,7 +73,7 @@
 context.start()\n
 \n
 if body is None:\n
-  body = context.asText()\n
+  body = context.getTextContent() #XXX This does not support structured text format.\n
 \n
 # Subject\n
 if subject is None:\n
@@ -115,7 +115,7 @@
   attachment_list = []\n
 document_type_list = context.getPortalDocumentTypeList()\n
 for attachment in context.getAggregateValueList():\n
-  mime_type, content = attachment.asMimeTypeAndContent()\n
+  mime_type, content = attachment.getMimeTypeAndContent()\n
   name = attachment.getReference()\n
 \n
   attachment_list.append({\'mime_type\':mime_type,\n
@@ -124,13 +124,17 @@
 \n
 # Build message per destination\n
 mail_message = None\n
-Event_viewMimeMessage = context.Event_viewMimeMessage\n
+if context.getTextFormat()==\'text/html\':\n
+  mail_template = context.Event_viewHtmlMimeMessage\n
+else:\n
+  mail_template = context.Event_viewMimeMessage\n
+\n
 for to_url in to_url_list:\n
-  multipart = Event_viewMimeMessage.as_message(mfrom=from_url,\n
-                                               mto=to_url,\n
-                                               subject=subject,\n
-                                               body=body,\n
-                                               encoding=\'utf-8\')\n
+  multipart = mail_template.as_message(mfrom=from_url,\n
+                                       mto=to_url,\n
+                                       subject=subject,\n
+                                       body=body,\n
+                                       encoding=\'utf-8\')\n
   for attachment_dict in attachment_list:\n
     multipart.add_file(data=attachment_dict[\'content\'],\n
                        content_type=attachment_dict[\'mime_type\'],\n
@@ -218,7 +222,7 @@
                             <string>content</string>
                             <string>name</string>
                             <string>mail_message</string>
-                            <string>Event_viewMimeMessage</string>
+                            <string>mail_template</string>
                             <string>multipart</string>
                             <string>attachment_dict</string>
                             <string>_getitem_</string>

Added: erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_viewHtmlMimeMessage.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_viewHtmlMimeMessage.xml?rev=21225&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_viewHtmlMimeMessage.xml (added)
+++ erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_viewHtmlMimeMessage.xml Thu May 29 17:11:09 2008
@@ -1,0 +1,79 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="MailTemplate" module="Products.MailTemplates.MailTemplate"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_bind_names</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>_asgns</string> </key>
+                        <value>
+                          <dictionary>
+                            <item>
+                                <key> <string>name_subpath</string> </key>
+                                <value> <string>traverse_subpath</string> </value>
+                            </item>
+                          </dictionary>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>_owner</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_text</string> </key>
+            <value> <string encoding="cdata"><![CDATA[
+
+<tal:body xmlns:tal="http://xml.zope.org/namespaces/tal"\n
+          xmlns:metal="http://xml.zope.org/namespaces/metal"\n
+          ><html><body><tal:x replace="structure options/body"/></body></html></tal:body>
+
+]]></string> </value>
+        </item>
+        <item>
+            <key> <string>content_type</string> </key>
+            <value> <string>text/html</string> </value>
+        </item>
+        <item>
+            <key> <string>expand</string> </key>
+            <value> <int>0</int> </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>Event_viewHtmlMimeMessage</string> </value>
+        </item>
+        <item>
+            <key> <string>mailhost</string> </key>
+            <value> <string>MailHost</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Modified: erp5/trunk/bt5/erp5_crm/bt/change_log
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_crm/bt/change_log?rev=21225&r1=21224&r2=21225&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_crm/bt/change_log (original)
+++ erp5/trunk/bt5/erp5_crm/bt/change_log Thu May 29 17:11:09 2008
@@ -1,5 +1,6 @@
 2008-5-29 yusei
 * Add type based method for Event.send and use MailTemplate to build mail message.
+* Add a minimum support of html mail.
 
 2008-5-29 yusei
 * Modifiy response transition in event_workflow, now it create a new event and send it to recepient immediately.

Modified: erp5/trunk/bt5/erp5_crm/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_crm/bt/revision?rev=21225&r1=21224&r2=21225&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_crm/bt/revision (original)
+++ erp5/trunk/bt5/erp5_crm/bt/revision Thu May 29 17:11:09 2008
@@ -1,1 +1,1 @@
-251
+253




More information about the Erp5-report mailing list