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`.
This commit is contained in:
Ankush Menat 2025-07-10 10:13:46 +05:30 committed by GitHub
parent 972adc54b1
commit 1fa97d404a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)