v2.1: add SMS module + SMS Log doctype + fixtures: voxtelesys_sms_log.py
This commit is contained in:
parent
d59564eeea
commit
c2e33611fd
1 changed files with 18 additions and 0 deletions
|
|
@ -0,0 +1,18 @@
|
||||||
|
"""Voxtelesys SMS Log controller."""
|
||||||
|
import frappe
|
||||||
|
from frappe.model.document import Document
|
||||||
|
|
||||||
|
|
||||||
|
class VoxtelesysSMSLog(Document):
|
||||||
|
def after_insert(self):
|
||||||
|
if self.direction == "Inbound":
|
||||||
|
frappe.publish_realtime(
|
||||||
|
"voxtelesys_sms_received",
|
||||||
|
{
|
||||||
|
"sms_log": self.name,
|
||||||
|
"message_id": self.message_id,
|
||||||
|
"from": self.from_number,
|
||||||
|
"to": self.to_number,
|
||||||
|
"body": (self.body or "")[:200],
|
||||||
|
},
|
||||||
|
)
|
||||||
Loading…
Reference in a new issue