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:
@ -26,7 +26,8 @@ class Settings extends APIEndpoint {
|
||||
&& Bridge::isMPSendingServiceEnabled()
|
||||
) {
|
||||
$bridge = new Bridge();
|
||||
$bridge->checkKey($settings['mta']['mailpoet_api_key']);
|
||||
$result = $bridge->checkKey($settings['mta']['mailpoet_api_key']);
|
||||
$bridge->updateSubscriberCount($result);
|
||||
}
|
||||
return $this->successResponse(Setting::getAll());
|
||||
}
|
||||
|
Reference in New Issue
Block a user