From 1fa97d404a139ce02ebe09263ecb4cc8726c9bd1 Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Thu, 10 Jul 2025 10:13:46 +0530 Subject: [PATCH] fix: Handle case differences while sending email to a document (#33270) This fails for doctypes where name isn't title case. E.g. `HD Ticket` becomes `Hd Ticket`. --- frappe/core/doctype/communication/communication.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frappe/core/doctype/communication/communication.py b/frappe/core/doctype/communication/communication.py index 28ca7abf4f..9e6907edd6 100644 --- a/frappe/core/doctype/communication/communication.py +++ b/frappe/core/doctype/communication/communication.py @@ -401,7 +401,11 @@ class Communication(Document, CommunicationEmailMixin): return for doctype, docname in parse_email([self.recipients, self.cc, self.bcc]): - if not frappe.db.get_value(doctype, docname, ignore=True): + # Both document and doctype names should be case insensitive in email addresses. + doctype = frappe.db.get_value("DocType", doctype) + if doctype: + docname = frappe.db.get_value(doctype, docname, ignore=True) + if not (doctype and docname): continue self.add_link(doctype, docname)