Explicitly resume sending also in key checking cron

[MAILPOET-3006]
This commit is contained in:
Jan Jakeš
2020-06-29 16:48:21 +02:00
committed by Veljko V
parent b10f903744
commit 9049b3c399

View File

@ -4,6 +4,7 @@ namespace MailPoet\Cron\Workers\KeyCheck;
use MailPoet\Config\ServicesChecker; use MailPoet\Config\ServicesChecker;
use MailPoet\Mailer\Mailer; use MailPoet\Mailer\Mailer;
use MailPoet\Mailer\MailerLog;
use MailPoet\Services\Bridge; use MailPoet\Services\Bridge;
use MailPoet\Settings\SettingsController; use MailPoet\Settings\SettingsController;
use MailPoetVendor\Carbon\Carbon; use MailPoetVendor\Carbon\Carbon;
@ -40,10 +41,17 @@ class SendingServiceKeyCheck extends KeyCheckWorker {
} }
public function checkKey() { public function checkKey() {
$wasPendingApproval = $this->servicesChecker->isMailPoetAPIKeyPendingApproval();
$mssKey = $this->settings->get(Mailer::MAILER_CONFIG_SETTING_NAME)['mailpoet_api_key']; $mssKey = $this->settings->get(Mailer::MAILER_CONFIG_SETTING_NAME)['mailpoet_api_key'];
$result = $this->bridge->checkMSSKey($mssKey); $result = $this->bridge->checkMSSKey($mssKey);
$this->bridge->storeMSSKeyAndState($mssKey, $result); $this->bridge->storeMSSKeyAndState($mssKey, $result);
$this->bridge->updateSubscriberCount($result); $this->bridge->updateSubscriberCount($result);
$isPendingApproval = $this->servicesChecker->isMailPoetAPIKeyPendingApproval();
if ($wasPendingApproval && !$isPendingApproval) {
MailerLog::resumeSending();
}
return $result; return $result;
} }
} }