}
$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
";
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