Reactivate all inactive subscribers when inactive interval is set to never

[MAILPOET-2003]
This commit is contained in:
Rostislav Wolny
2019-04-24 09:11:56 +02:00
committed by M. Shull
parent e5f5b3534c
commit f5d154d680
4 changed files with 35 additions and 3 deletions

View File

@ -33,6 +33,17 @@ class InactiveSubscribersController {
return $this->activateSubscribers($threshold_date, $batch_size);
}
/**
* @return void
*/
function reactivateInactiveSubscribers() {
$reactivate_all_inactive_query = sprintf(
"UPDATE %s SET status = '%s' WHERE status = '%s';",
Subscriber::$_table, Subscriber::STATUS_SUBSCRIBED, Subscriber::STATUS_INACTIVE
);
\ORM::rawExecute($reactivate_all_inactive_query);
}
/**
* @param int $days_to_inactive
* @return Carbon