diff --git a/lib/Models/Subscriber.php b/lib/Models/Subscriber.php index 40721c585f..0a21b0420b 100644 --- a/lib/Models/Subscriber.php +++ b/lib/Models/Subscriber.php @@ -1,6 +1,7 @@ orderByAsc('name') ->findArray(); } + + /** + * This method is here only for BC fix of 3rd party plugin integration. + * @see https://kb.mailpoet.com/article/195-add-subscribers-through-your-own-form-or-plugin + * @deprecated + */ + static function subscribe($subscriber_data = [], $segment_ids = []) { + trigger_error('Calling Subscriber::subscribe() is deprecated and will be removed. Use MailPoet\API\MP\v1\API instead. ', E_USER_DEPRECATED); + $service = ContainerWrapper::getInstance()->get(\MailPoet\Subscribers\SubscriberActions::class); + return $service->subscribe($subscriber_data, $segment_ids); + } }