From fbee4bc02a27fe06f9bcae230da922f97c09475d Mon Sep 17 00:00:00 2001 From: ci2014 Date: Fri, 10 Jan 2020 19:50:18 +0100 Subject: [PATCH] fix(email): send notification even if there are no attachments (#9228) Call communication.notify even if there is no _attachments attribute, otherwise the notification will not be sent with the current hotfix (24f1540) Duplicate for develop branch of https://github.com/frappe/frappe/pull/9227 --- frappe/email/doctype/email_account/email_account.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/frappe/email/doctype/email_account/email_account.py b/frappe/email/doctype/email_account/email_account.py index 2bbdf9db20..a108225a48 100755 --- a/frappe/email/doctype/email_account/email_account.py +++ b/frappe/email/doctype/email_account/email_account.py @@ -293,8 +293,12 @@ class EmailAccount(Document): else: frappe.db.commit() - if communication and hasattr(communication, "_attachments"): - attachments = [d.file_name for d in communication._attachments] + if communication: + attachments = [] + + if hasattr(communication, '_attachments'): + attachments = [d.file_name for d in communication._attachments] + communication.notify(attachments=attachments, fetched_from_email_account=True) #notify if user is linked to account