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

erp5_short_message: activate call to portal_sms.send

This way it is isolated it in a transaction that is less likely to fail. Activate with max_retry=0 and conflict_retry=False not to send activity twice in case of error.
As with email, if there was an error in activity processing, it is advised to investigate the transport logs to see if message was send or not.
parent 81711cbe
...@@ -81,8 +81,20 @@ if not body:\n ...@@ -81,8 +81,20 @@ if not body:\n
if not context.getStartDate():\n if not context.getStartDate():\n
context.setStartDate(DateTime())\n context.setStartDate(DateTime())\n
\n \n
context.portal_sms.send(text=body,recipient=to_url,sender=from_url,sender_title=from_title,message_type="text",\n context.portal_sms.activate(\n
test=download, document_relative_url=context.getRelativeUrl(), **kw)\n queue="SQLQueue",\n
# We do not retry these activities not to send SMS multiple times\n
max_retry=0,\n
conflict_retry=False,\n
).send(\n
text=body,\n
recipient=to_url,\n
sender=from_url,\n
sender_title=from_title,\n
message_type="text",\n
test=download,\n
document_relative_url=context.getRelativeUrl(),\n
**kw)\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
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