Rework subscriber count reporting after a code review [MAILPOET-804]

Move updateSubscriberCount() out of checkKey()
Move wp_remote_post() to request()
Simplify a response check
This commit is contained in:
Alexey Stoletniy
2017-02-01 21:04:11 +03:00
parent be0c9b71d8
commit dc371d76ca
5 changed files with 34 additions and 18 deletions

View File

@ -88,6 +88,7 @@ class SendingServiceKeyCheck {
try {
$mailer_config = Mailer::getMailerConfig();
$result = $this->bridge->checkKey($mailer_config['mailpoet_api_key']);
$this->bridge->updateSubscriberCount($result);
} catch (\Exception $e) {
$result = false;
}