Commit 765503ab 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 969bfe06
......@@ -29,5 +29,17 @@ if not body:
if not context.getStartDate():
context.setStartDate(DateTime())
context.portal_sms.send(text=body,recipient=to_url,sender=from_url,sender_title=from_title,message_type="text",
test=download, document_relative_url=context.getRelativeUrl(), **kw)
context.portal_sms.activate(
activity="SQLQueue",
# We do not retry these activities not to send SMS multiple times
max_retry=0,
conflict_retry=False,
).send(
text=body,
recipient=to_url,
sender=from_url,
sender_title=from_title,
message_type="text",
test=download,
document_relative_url=context.getRelativeUrl(),
**kw)
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