Commit 011c69f4 authored by Sebastien Robin's avatar Sebastien Robin

allow to use script after sending sms, this allows to store mesage ids on documents

git-svn-id: https://svn.erp5.org/repos/experimental@1957 bc57dcba-3610-0410-ab4f-dc20bb96b918
parent f169f0bc
......@@ -51,12 +51,25 @@ class SMSTool(BaseTool):
security.declareProtected(ManagePortal, 'send')
def send(self, text,recipient, sender=None, message_type="text",
test=False, gateway_reference='default', **kw):
test=False, gateway_reference='default',
document_relative_url=None, activate_kw=None, **kw):
"""
document_relative_url (optional) : allows to send back result to a document
"""
gateway = self.find(gateway_reference)
return gateway.send(text,recipient,sender=sender, message_type="text",
message_id_list = gateway.send(text,recipient,
sender=sender, message_type="text",
test=False, **kw)
if getattr(self, 'SMSTool_afterSend'):
# We need to use activities in order to avoid any conflict
send_activate_kw = {}
if activate_kw is not None:
send_activate_kw.update(**activate_kw)
self.activate(**send_activate_kw).SMSTool_afterSend(
message_id_list,
document_relative_url=document_relative_url, **kw)
security.declareProtected(ManagePortal, 'getMessageStatus')
def getMessageStatus(self,message_id, gateway_reference='default'):
......
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