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
No related merge requests found
...@@ -29,5 +29,17 @@ if not body: ...@@ -29,5 +29,17 @@ if not body:
if not context.getStartDate(): if not context.getStartDate():
context.setStartDate(DateTime()) context.setStartDate(DateTime())
context.portal_sms.send(text=body,recipient=to_url,sender=from_url,sender_title=from_title,message_type="text", context.portal_sms.activate(
test=download, document_relative_url=context.getRelativeUrl(), **kw) 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