From aba5942212fbbb5c1ec83629c65b44efc4a4b3c3 Mon Sep 17 00:00:00 2001 From: "CA. B.C.Chechani" Date: Mon, 22 Jul 2024 15:39:35 +0530 Subject: [PATCH] Optimise the WhatsApp Notification --- .../whatsapp_notification.json | 32 ++++++++++++++----- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/frappe_whatsapp/frappe_whatsapp/doctype/whatsapp_notification/whatsapp_notification.json b/frappe_whatsapp/frappe_whatsapp/doctype/whatsapp_notification/whatsapp_notification.json index 1ee5853..558adef 100644 --- a/frappe_whatsapp/frappe_whatsapp/doctype/whatsapp_notification/whatsapp_notification.json +++ b/frappe_whatsapp/frappe_whatsapp/doctype/whatsapp_notification/whatsapp_notification.json @@ -6,6 +6,8 @@ "editable_grid": 1, "engine": "InnoDB", "field_order": [ + "html_notification", + "section_break_fds", "notification_type", "reference_doctype", "field_name", @@ -31,16 +33,18 @@ "fields": [ { "depends_on": "eval:['DocType Event', 'Permission Query'].includes(doc.notification_type)", + "description": "Select the existing Reference Document Type", "fieldname": "reference_doctype", "fieldtype": "Link", "in_list_view": 1, "in_standard_filter": 1, "label": "Reference Document Type", - "options": "DocType", - "reqd": 1 + "mandatory_depends_on": "eval:['DocType Event', 'Permission Query'].includes(doc.notification_type)", + "options": "DocType" }, { "depends_on": "eval:doc.notification_type == \"Scheduler Event\"", + "description": "Select how often the event should occur in relation to the document type.", "fieldname": "event_frequency", "fieldtype": "Select", "label": "Event Frequency", @@ -49,6 +53,7 @@ }, { "depends_on": "eval:doc.notification_type==='DocType Event'", + "description": "Select the specific event related to the document type", "fieldname": "doctype_event", "fieldtype": "Select", "label": "DocType Event", @@ -75,6 +80,7 @@ "options": "
doc.grand_total > 0
\n\n

Conditions should be written in simple Python. Please use properties available in the form only.

\n\n

Example:

doc.status=='Enabled' 

\n\n

For scheduler events you can use follwing methods

\n

Allowed functions:

\n

Example:

doc.creation > frappe.utils.add_to_date(frappe.utils.now_datetime(\n), days=-5, as_string=True, as_datetime=True) 

\n\n

\n\t\n\t\tFinally set the contact list to send messages. This should be set only in case of scheduled events.\n\t\n
\ndoc._contact_list = [\"919123456789\"]\n

" }, { + "description": "
\n

Select the type of notification.

\n \n\n
\n", "fieldname": "notification_type", "fieldtype": "Select", "in_list_view": 1, @@ -84,6 +90,7 @@ "reqd": 1 }, { + "description": "Select an existing template or click on \"Create New WhatsApp Template\" to create a new one.", "fieldname": "template", "fieldtype": "Link", "label": "Template", @@ -94,15 +101,15 @@ "fieldname": "condition", "fieldtype": "Code", "label": "Condition", - "options": "Python Expression" + "options": "Python" }, { "depends_on": "eval:['DocType Event'].includes(doc.notification_type)", - "description": "Mobile number field", + "description": "Enter the name of the field.", "fieldname": "field_name", - "fieldtype": "Data", + "fieldtype": "Select", "label": "Field Name", - "reqd": 1 + "mandatory_depends_on": "eval:['DocType Event'].includes(doc.notification_type)" }, { "fieldname": "column_break_12", @@ -164,11 +171,20 @@ "fieldname": "attach_from_field", "fieldtype": "Data", "label": "Attach from field " + }, + { + "fieldname": "html_notification", + "fieldtype": "HTML", + "options": "
\n \n
\n
Define your Response Data Once
\n
This section allows you to define your response data in a structured manner. Please fill in the required fields and ensure the accuracy of the information.
\n
\n
\n" + }, + { + "fieldname": "section_break_fds", + "fieldtype": "Section Break" } ], "index_web_pages_for_search": 1, "links": [], - "modified": "2023-11-23 17:18:54.663077", + "modified": "2024-07-22 14:07:31.335529", "modified_by": "Administrator", "module": "Frappe Whatsapp", "name": "WhatsApp Notification", @@ -192,4 +208,4 @@ "sort_order": "DESC", "states": [], "track_changes": 1 -} \ No newline at end of file +}