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

little simplifications

parent 53fbcf21
...@@ -59,11 +59,11 @@ body = event.getTextContent()\n ...@@ -59,11 +59,11 @@ body = event.getTextContent()\n
sender = event.getSourceValue()\n sender = event.getSourceValue()\n
if kw.get("from_url") is not None:\n if kw.get("from_url") is not None:\n
from_url = kw.get("from_url")\n from_url = kw.get("from_url")\n
elif event.getSource() is not None:\n elif sender is not None:\n
sender = event.getSourceValue()\n
from_url = formataddr((sender.getTitle(), sender.getDefaultEmailText()))\n from_url = formataddr((sender.getTitle(), sender.getDefaultEmailText()))\n
else:\n else:\n
from_url = portal.portal_preferences.getPreferredEventSenderEmail()\n from_url = portal.portal_preferences.getPreferredEventSenderEmail()\n
\n
attachment_list = kw.pop(\'attachment_list\', [])\n attachment_list = kw.pop(\'attachment_list\', [])\n
\n \n
to_url = formataddr((context.getTitle(), context.getDefaultEmailText()))\n to_url = formataddr((context.getTitle(), context.getDefaultEmailText()))\n
...@@ -72,7 +72,7 @@ document_type_list = list(event.getPortalEmbeddedDocumentTypeList()) + list(even ...@@ -72,7 +72,7 @@ document_type_list = list(event.getPortalEmbeddedDocumentTypeList()) + list(even
embedded_file_list = event.getAggregateValueList(portal_type=document_type_list)\n embedded_file_list = event.getAggregateValueList(portal_type=document_type_list)\n
\n \n
content_type = event.getContentType()\n content_type = event.getContentType()\n
mail_message = context.Base_createMailMessageAsString(from_url,\n mail_message = portal.Base_createMailMessageAsString(from_url,\n
to_url,\n to_url,\n
subject,\n subject,\n
body,\n body,\n
...@@ -83,6 +83,9 @@ mail_message = context.Base_createMailMessageAsString(from_url,\n ...@@ -83,6 +83,9 @@ mail_message = context.Base_createMailMessageAsString(from_url,\n
event.sendMailHostMessage(mail_message)\n event.sendMailHostMessage(mail_message)\n
\n \n
if not event.hasData():\n if not event.hasData():\n
# Store the content of the email as data, so that we can keep a reference to\n
# the email that was actually sent.\n
# XXX this has no meaning in the case of an email with multiple recipents.\n
if len(embedded_file_list):\n if len(embedded_file_list):\n
# do not store aggregated documents in Email document\n # do not store aggregated documents in Email document\n
# to avoid duplicate data\n # to avoid duplicate data\n
......
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