From 4668d6c3a1135fea74040e70ab4bc12e6b63599d Mon Sep 17 00:00:00 2001 From: shridhar Date: Sun, 9 Jun 2024 17:22:54 +0530 Subject: [PATCH] fix: set default content type to text --- .../doctype/whatsapp_notification/whatsapp_notification.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frappe_whatsapp/frappe_whatsapp/doctype/whatsapp_notification/whatsapp_notification.py b/frappe_whatsapp/frappe_whatsapp/doctype/whatsapp_notification/whatsapp_notification.py index 103257c..eb0a8a0 100644 --- a/frappe_whatsapp/frappe_whatsapp/doctype/whatsapp_notification/whatsapp_notification.py +++ b/frappe_whatsapp/frappe_whatsapp/doctype/whatsapp_notification/whatsapp_notification.py @@ -57,7 +57,7 @@ def send_template_message(self, doc: Document): """Specific to Document Event triggered Server Scripts.""" if self.disabled: return - self.content_type = 'text' + doc_data = doc.as_dict() if self.condition: # check if condition satisfies @@ -186,6 +186,9 @@ def notify(self, data): headers=headers, data=json.dumps(data) ) + if not self.get("content_type"): + self.content_type = 'text' + frappe.get_doc({ "doctype": "WhatsApp Message", "type": "Outgoing",