From e993df311be397cd8422ddb44ac979bc9ed5e06d Mon Sep 17 00:00:00 2001 From: sokumon Date: Sun, 11 May 2025 11:54:04 +0530 Subject: [PATCH] fix: add email header --- .../doctype/notification_log/notification_log.json | 13 ++++++++++--- .../doctype/notification_log/notification_log.py | 10 +++------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/frappe/desk/doctype/notification_log/notification_log.json b/frappe/desk/doctype/notification_log/notification_log.json index c3b3c09d92..3228392a92 100644 --- a/frappe/desk/doctype/notification_log/notification_log.json +++ b/frappe/desk/doctype/notification_log/notification_log.json @@ -16,7 +16,8 @@ "attachment_link", "open_reference_document", "from_user", - "link" + "link", + "email_header" ], "fields": [ { @@ -98,12 +99,17 @@ "fieldtype": "Data", "hidden": 1, "label": "Link" + }, + { + "fieldname": "email_header", + "fieldtype": "Data", + "label": "Email Header" } ], "hide_toolbar": 1, "in_create": 1, "links": [], - "modified": "2024-08-03 09:38:10.497711", + "modified": "2025-05-10 23:58:54.717673", "modified_by": "Administrator", "module": "Desk", "name": "Notification Log", @@ -119,9 +125,10 @@ "share": 1 } ], + "row_format": "Dynamic", "sort_field": "creation", "sort_order": "DESC", "states": [], "title_field": "subject", "track_seen": 1 -} \ No newline at end of file +} diff --git a/frappe/desk/doctype/notification_log/notification_log.py b/frappe/desk/doctype/notification_log/notification_log.py index b08e6f0597..e4ae43d113 100644 --- a/frappe/desk/doctype/notification_log/notification_log.py +++ b/frappe/desk/doctype/notification_log/notification_log.py @@ -152,13 +152,9 @@ def get_email_header(doc, language: str | None = None): "Assignment": _("Assignment Update on {0}", lang=language).format(docname), "Share": _("New Document Shared {0}", lang=language).format(docname), } - additional_email_headers = frappe.get_hooks("notification_email_header") - if len(additional_email_headers) > 0: - header_map = { - **header_map, - **format_email_header(additional_email_headers, language=language, docname=docname), - } - return header_map[doc.type or "Default"] + if not doc.email_header: + doc.email_header = header_map[doc.type or "default"] + return doc.email_header def format_email_header(header_map, language, docname):