Skip to content
Snippets Groups Projects
Unverified Commit 29d047d7 authored by Seamus Lee's avatar Seamus Lee Committed by GitHub
Browse files

Merge pull request #21564 from lcdservices/dev-core-2850

#2850 update_email_resetdate consider opt out on hold
parents 29d21638 b0aecc75
No related branches found
No related tags found
No related merge requests found
......@@ -275,6 +275,7 @@ class CRM_Mailing_Event_BAO_Delivered extends CRM_Mailing_Event_DAO_Delivered {
->createWithColumns('id int primary key, reset_date datetime');
$temporaryTableName = $temporaryTable->getName();
// also exclude on_hold = opt-out (2)
$query = "
INSERT INTO {$temporaryTableName} (id, reset_date)
SELECT civicrm_email.id as email_id,
......@@ -288,6 +289,7 @@ class CRM_Mailing_Event_BAO_Delivered extends CRM_Mailing_Event_DAO_Delivered {
AND civicrm_mailing_job.status = 'Complete'
AND civicrm_mailing_job.end_date BETWEEN DATE_SUB(NOW(), INTERVAL $maxDays day) AND DATE_SUB(NOW(), INTERVAL $minDays day)
AND (civicrm_email.reset_date IS NULL OR civicrm_email.reset_date < civicrm_mailing_job.start_date)
AND civicrm_email.on_hold != 2
GROUP BY civicrm_email.id
";
CRM_Core_DAO::executeQuery($query);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment