iberCustomField) { $customField = $subscriberCustomField->getCustomField(); if (!$customField) continue; $customFieldValues[$customField->getId()] = $subscriberCustomField->getValue(); } return array_map(function(CustomFieldEntity $customFieldEntity) use($customFieldValues) { $customField = [ 'id' => 'cf_' . $customFieldEntity->getId(), 'name' => $customFieldEntity->getName(), 'type' => $customFieldEntity->getType(), 'params' => $customFieldEntity->getParams(), ]; $customField['params']['value'] = $customFieldValues[$customFieldEntity->getId()] ?? null; if ($customField['type'] === 'date') { $dateFormats = $this->dateBlock->getDateFormats(); $customField['params']['date_format'] = array_shift( $dateFormats[$customField['params']['date_type']] ); } if (!isset($customField['params']['label'])) { $customField['params']['label'] = $customField['name']; } return $customField; }, $this->customFieldsRepository->findAll()); } private function getBasicFields(SubscriberEntity $subscriber): array { return [ [ 'id' => 'first_name', 'type' => 'text', 'params' => [ 'label' => __('First name', 'mailpoet'), 'value' => $subscriber->getFirstName(), 'disabled' => ($subscriber->isWPUser() || $subscriber->getIsWoocommerceUser()), ], ], [ 'id' => 'last_name', 'type' => 'text', 'params' => [ 'label' => __('Last name', 'mailpoet'), 'value' => $subscriber->getLastName(), 'disabled' => ($subscriber->isWPUser() || $subscriber->getIsWoocommerceUser()), ], ], [ 'id' => 'status', 'type' => 'select', 'params' => [ 'required' => true, 'label' => __('Status', 'mailpoet'), 'values' => [ [ 'value' => [ SubscriberEntity::STATUS_SUBSCRIBED => __('Subscribed', 'mailpoet'), ], 'is_checked' => ( $subscriber->getStatus() === SubscriberEntity::STATUS_SUBSCRIBED ), ], [ 'value' => [ SubscriberEntity::STATUS_UNSUBSCRIBED => __('Unsubscribed', 'mailpoet'), ], 'is_checked' => ( $subscriber->getStatus() === SubscriberEntity::STATUS_UNSUBSCRIBED ), ], [ 'value' => [ SubscriberEntity::STATUS_BOUNCED => __('Bounced', 'mailpoet'), ], 'is_checked' => ( $subscriber->getStatus() === SubscriberEntity::STATUS_BOUNCED ), 'is_disabled' => true, 'is_hidden' => ( $subscriber->getStatus() !== SubscriberEntity::STATUS_BOUNCED ), ], [ 'value' => [ SubscriberEntity::STATUS_INACTIVE => __('Inactive', 'mailpoet'), ], 'is_checked' => ( $subscriber->getStatus() === SubscriberEntity::STATUS_INACTIVE ), 'is_hidden' => ( $subscriber->getStatus() !== SubscriberEntity::STATUS_INACTIVE ), ], ], ], ], ]; } private function getSegmentField(SubscriberEntity $subscriber): array { // Get default segments $criteria = [ 'type' => SegmentEntity::TYPE_DEFAULT, 'deletedAt' => null, 'displayInManageSubscriptionPage' => true, ]; $segments = $this->segmentsRepository->findBy($criteria, ['name' => Criteria::ASC]); $subscribedSegmentIds = []; foreach ($subscriber->getSubscriberSegments() as $subscriberSegment) { $segment = $subscriberSegment->getSegment(); if (!$segment) continue; if ($subscriberSegment->getStatus() === SubscriberEntity::STATUS_SUBSCRIBED) { $subscribedSegmentIds[] = $segment->getId(); } } $segments = array_map(function(SegmentEntity $segment) use($subscribedSegmentIds) { return [ 'id' => $segment->getId(), 'name' => $segment->getName(), 'is_checked' => in_array($segment->getId(), $subscribedSegmentIds), ]; }, $segments); return [ 'id' => 'segments', 'type' => 'segment', 'params' => [ 'label' => __('Your lists', 'mailpoet'), 'values' => $segments, ], ]; } }
Fatal error: Uncaught Error: Class "MailPoet\Subscription\ManageSubscriptionFormRenderer" not found in /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php:5398 Stack trace: #0 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(2640): MailPoetGenerated\FreeCachedContainer->getManageSubscriptionFormRendererService() #1 /htdocs/wp-content/plugins/mailpoet/vendor-prefixed/symfony/dependency-injection/Container.php(122): MailPoetGenerated\FreeCachedContainer->getInitializerService() #2 /htdocs/wp-content/plugins/mailpoet/vendor-prefixed/symfony/dependency-injection/Container.php(110): MailPoetVendor\Symfony\Component\DependencyInjection\Container->make('MailPoet\\Config...', 1) #3 /htdocs/wp-content/plugins/mailpoet/lib/DI/ContainerWrapper.php(39): MailPoetVendor\Symfony\Component\DependencyInjection\Container->get('MailPoet\\Config...') #4 /htdocs/wp-content/plugins/mailpoet/mailpoet_initializer.php(89): MailPoet\DI\ContainerWrapper->get('MailPoet\\Config...') #5 /htdocs/wp-content/plugins/mailpoet/mailpoet.php(194): require_once('/htdocs/wp-cont...') #6 /htdocs/wp-settings.php(526): include_once('/htdocs/wp-cont...') #7 /htdocs/wp-config.php(85): require_once('/htdocs/wp-sett...') #8 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #9 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #10 /htdocs/index.php(17): require('/htdocs/wp-blog...') #11 {main} thrown in /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php on line 5398