Commit e31e99d1 authored by Yusei Tahara's avatar Yusei Tahara

2008-5-29 yusei

* Add a minimum support of html mail.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@21225 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5d2f42f3
......@@ -73,7 +73,7 @@ context.order()\n
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 @@ if attachment_list is None:\n
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,9 +124,13 @@ for attachment in context.getAggregateValueList():\n
\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
multipart = mail_template.as_message(mfrom=from_url,\n
mto=to_url,\n
subject=subject,\n
body=body,\n
......@@ -218,7 +222,7 @@ if download:\n
<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>
......
<?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>
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.
......
251
\ No newline at end of file
253
\ No newline at end of file
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