From 94042e58c28d635b50bac4a9c50849fd06f0bf08 Mon Sep 17 00:00:00 2001 From: Vakeesan Date: Thu, 18 Feb 2021 16:28:18 +0000 Subject: [PATCH] dev/core#2383 fix for --- CRM/Core/BAO/ActionSchedule.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CRM/Core/BAO/ActionSchedule.php b/CRM/Core/BAO/ActionSchedule.php index 47fdd617ca17..6845a656dc35 100644 --- a/CRM/Core/BAO/ActionSchedule.php +++ b/CRM/Core/BAO/ActionSchedule.php @@ -506,7 +506,7 @@ protected static function prepareMailingQuery($mapping, $actionSchedule) { 'casMailingJoinType' => ($actionSchedule->limit_to == 0) ? 'LEFT JOIN' : 'INNER JOIN', 'casMappingId' => $mapping->getId(), 'casMappingEntity' => $mapping->getEntity(), - 'casEntityJoinExpr' => 'e.id = reminder.entity_id', + 'casEntityJoinExpr' => 'e.id = IF(reminder.entity_table = "civicrm_contact", reminder.contact_id, reminder.entity_id)', ]); if ($actionSchedule->limit_to == 0) {