Address PR review remarks [MAILPOET-1721]

This commit is contained in:
wxa
2019-01-22 12:25:59 +03:00
parent a4ff9822ad
commit 5bf968fbc6
4 changed files with 7 additions and 7 deletions

View File

@ -144,10 +144,10 @@ class API {
$found_segments_ids = array();
foreach($found_segments as $segment) {
if($segment->type === Segment::TYPE_WP_USERS) {
throw new \Exception(__(sprintf("Can't subscribe to a WordPress Users list with ID %d.", $segment->id), 'mailpoet'));
throw new \Exception(__(sprintf("Can't unsubscribe from a WordPress Users list with ID %d.", $segment->id), 'mailpoet'));
}
if($segment->type === Segment::TYPE_WC_USERS) {
throw new \Exception(__(sprintf("Can't subscribe to a WooCommerce Customers list with ID %d.", $segment->id), 'mailpoet'));
throw new \Exception(__(sprintf("Can't unsubscribe from a WooCommerce Customers list with ID %d.", $segment->id), 'mailpoet'));
}
$found_segments_ids[] = $segment->id;
}
@ -168,7 +168,7 @@ class API {
function getLists() {
return Segment::whereNotIn('type', [Segment::TYPE_WP_USERS, Segment::TYPE_WC_USERS])
->findArray();
->findArray();
}
function addSubscriber(array $subscriber, $segments = array(), $options = array()) {