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

CRM: send all events (Compatibility warning below)

This rely on a change in erp5_base where Event_send does nothing and MailMessage_send sends email instead, otherwise mails will be sent for all started events.
parent b3ff78f0
...@@ -51,20 +51,17 @@ ...@@ -51,20 +51,17 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>event = state_change[\'object\']\n <value> <string>event = state_change[\'object\']\n
portal = event.getPortalObject()\n
\n \n
# FIXME: we should always call send here, and the type based method must\n # Manually turn the SafeMapping from kwargs into a dict.\n
# decide what to do.\n kwargs = dict()\n
\n # XXX maybe at least we could introspect the arguments ?\n
if event.getPortalType() in (\'Mail Message\', ):\n for key in (\'from_url\', \'to_url\', \'reply_url\', \'subject\', \n
if event.getSource():\n \'body\', \'attachment_format\', \'attachment_list\', \'download\'):\n
event.send()\n state_change_arg = state_change[\'kwargs\'].get(key)\n
else:\n if state_change_arg:\n
# FIXME: this "email only" logic must be moved to MailMessage_send\n kwargs[key] = state_change_arg\n
sender_email = portal.portal_preferences.getPreferredEventSenderEmail()\n \n
if not sender_email:\n event.send(**kwargs) # will call type based method\n
raise NotImplementedError(\'Preferred Event Sender Email not configured\')\n
event.send(from_url=portal.portal_preferences.getPreferredEventSenderEmail())\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
680 684
\ No newline at end of file \ 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