From 89aa83d03a079744cc674bdb1b1ae986f7ccba83 Mon Sep 17 00:00:00 2001 From: Tano Rojas Date: Thu, 11 Nov 2021 21:35:46 +0700 Subject: [PATCH] WHF-179: Handle activity creation for emails to organization contacts Included in CiviCRM 5.44 PR: https://github.com/civicrm/civicrm-core/pull/21983 --- CRM/Utils/Mail/Incoming.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CRM/Utils/Mail/Incoming.php b/CRM/Utils/Mail/Incoming.php index a11961081250..0b7e2cd9420f 100644 --- a/CRM/Utils/Mail/Incoming.php +++ b/CRM/Utils/Mail/Incoming.php @@ -452,6 +452,12 @@ public static function getContactID($email, $name = NULL, $create = TRUE, &$mail $contactID = NULL; if ($dao) { $contactID = $dao->contact_id; + } else { + $dao = CRM_Contact_BAO_Contact::matchContactOnEmail($email, 'Organization'); + + if ($dao) { + $contactID = $dao->contact_id; + } } $result = NULL;