Files
piratepoet/lib/Cron/Workers/KeyCheck/SendingServiceKeyCheck.php
Jan Jakeš 54549ff037 Convert variable names to camel case
[MAILPOET-1796]
2020-01-14 15:22:42 +01:00

32 lines
849 B
PHP

<?php
namespace MailPoet\Cron\Workers\KeyCheck;
use MailPoet\Mailer\Mailer;
use MailPoet\Services\Bridge;
use MailPoet\Settings\SettingsController;
class SendingServiceKeyCheck extends KeyCheckWorker {
const TASK_TYPE = 'sending_service_key_check';
/** @var SettingsController */
private $settings;
public function __construct(SettingsController $settings) {
$this->settings = $settings;
parent::__construct();
}
public function checkProcessingRequirements() {
return Bridge::isMPSendingServiceEnabled();
}
public function checkKey() {
$mssKey = $this->settings->get(Mailer::MAILER_CONFIG_SETTING_NAME)['mailpoet_api_key'];
$result = $this->bridge->checkMSSKey($mssKey);
$this->bridge->storeMSSKeyAndState($mssKey, $result);
$this->bridge->updateSubscriberCount($result);
return $result;
}
}