From 7b6e49fec719a22a9deec1621162f81e9b45c424 Mon Sep 17 00:00:00 2001 From: jitendrapurohit Date: Tue, 9 Jun 2015 17:13:32 +0530 Subject: [PATCH] CRM-16572 - CiviMail sending to primary instead of bulk email account for smart groups --- CRM/Mailing/BAO/Mailing.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CRM/Mailing/BAO/Mailing.php b/CRM/Mailing/BAO/Mailing.php index df7f2835e6..288403b295 100644 --- a/CRM/Mailing/BAO/Mailing.php +++ b/CRM/Mailing/BAO/Mailing.php @@ -425,7 +425,7 @@ WHERE $mg.entity_table = '$group' } $smartGroupInclude = " -INSERT IGNORE INTO I_$job_id (email_id, contact_id) +REPLACE INTO I_$job_id (email_id, contact_id) SELECT civicrm_email.id as email_id, c.id as contact_id FROM civicrm_contact c INNER JOIN civicrm_email ON civicrm_email.contact_id = c.id @@ -442,7 +442,7 @@ $order_by "; if ($mode == 'sms') { $smartGroupInclude = " -INSERT IGNORE INTO I_$job_id (phone_id, contact_id) +REPLACE INTO I_$job_id (phone_id, contact_id) SELECT p.id as phone_id, c.id as contact_id FROM civicrm_contact c INNER JOIN civicrm_phone p ON p.contact_id = c.id -- 2.25.1