createNotStatsJoinCondition($parameterSuffix, $linkIds) )->setParameter('newsletter' . $parameterSuffix, $newsletterId); $where .= ' AND stats.id IS NULL'; } else { $queryBuilder = $queryBuilder->innerJoin( $subscribersTable, $statsTable, 'stats', "stats.subscriber_id = $subscribersTable.id AND stats.newsletter_id = :newsletter" . $parameterSuffix )->setParameter('newsletter' . $parameterSuffix, $newsletterId); } if ($action === EmailAction::ACTION_CLICKED && $operator !== DynamicSegmentFilterData::OPERATOR_NONE && $linkIds) { $where .= ' AND stats.link_id IN (:links' . $parameterSuffix . ')'; } if ($operator === DynamicSegmentFilterData::OPERATOR_ALL) { $queryBuilder->groupBy('subscriber_id'); if ($linkIds) { $queryBuilder->having('COUNT(1) = ' . count($linkIds)); } else { // Case when a user selects all of, but doesn't specify links == all of all links. $linksTable = $this->entityManager->getClassMetadata(NewsletterLinkEntity::class)->getTableName(); $linksQueryBuilder = $this->entityManager->getConnection()->createQueryBuilder(); $linkCount = $linksQueryBuilder->select('count(id)') ->from($linksTable) ->where('newsletter_id = :newsletter_id') ->setParameter('newsletter_id', $newsletterId) ->execute() ->fetchOne(); $queryBuilder->having('COUNT(1) = ' . $linkCount); } } $queryBuilder = $queryBuilder->andWhere($where); if ($linkIds) { $queryBuilder = $queryBuilder ->setParameter('links' . $parameterSuffix, $linkIds, Connection::PARAM_STR_ARRAY); } return $queryBuilder; } private function applyForOpenedActions(QueryBuilder $queryBuilder, DynamicSegmentFilterData $filterData, string $parameterSuffix): QueryBuilder { $operator = $filterData->getParam('operator') ?? DynamicSegmentFilterData::OPERATOR_ANY; $action = $filterData->getAction(); $newsletters = $filterData->getParam('newsletters'); $statsSentTable = $this->entityManager->getClassMetadata(StatisticsNewsletterEntity::class)->getTableName(); $subscribersTable = $this->entityManager->getClassMetadata(SubscriberEntity::class)->getTableName(); $statsTable = $this->entityManager->getClassMetadata(StatisticsOpenEntity::class)->getTableName(); $where = '1'; if ($operator === DynamicSegmentFilterData::OPERATOR_NONE) { $queryBuilder = $queryBuilder->innerJoin( $subscribersTable, $statsSentTable, 'statssent', "$subscribersTable.id = statssent.subscriber_id AND statssent.newsletter_id IN (:newsletters" . $parameterSuffix . ')' )->leftJoin( 'statssent', $statsTable, 'stats', "statssent.subscriber_id = stats.subscriber_id AND stats.newsletter_id IN (:newsletters" . $parameterSuffix . ')' )->setParameter('newsletters' . $parameterSuffix, $newsletters, Connection::PARAM_INT_ARRAY); $where .= ' AND stats.id IS NULL'; } else { $queryBuilder = $queryBuilder->innerJoin( $subscribersTable, $statsTable, 'stats', "stats.subscriber_id = $subscribersTable.id AND stats.newsletter_id IN (:newsletters" . $parameterSuffix . ')' )->setParameter('newsletters' . $parameterSuffix, $newsletters, Connection::PARAM_INT_ARRAY); if ($operator === DynamicSegmentFilterData::OPERATOR_ALL) { $queryBuilder->groupBy('subscriber_id'); $queryBuilder->having('COUNT(1) = ' . count($newsletters)); } } if (($action === EmailAction::ACTION_OPENED) && ($operator !== DynamicSegmentFilterData::OPERATOR_NONE)) { $queryBuilder->andWhere('stats.user_agent_type = :userAgentType') ->setParameter('userAgentType', UserAgentEntity::USER_AGENT_TYPE_HUMAN); } if ($action === EmailAction::ACTION_MACHINE_OPENED) { $queryBuilder->andWhere('(stats.user_agent_type = :userAgentType)') ->setParameter('userAgentType', UserAgentEntity::USER_AGENT_TYPE_MACHINE); } $queryBuilder = $queryBuilder->andWhere($where); return $queryBuilder; } private function createNotStatsJoinCondition(string $parameterSuffix, array $linkIds = null): string { $clause = "statssent.subscriber_id = stats.subscriber_id AND stats.newsletter_id = :newsletter" . $parameterSuffix; if ($linkIds) { $clause .= ' AND stats.link_id IN (:links' . $parameterSuffix . ')'; } return $clause; } private function applyForWasSentAction(QueryBuilder $queryBuilder, DynamicSegmentFilterData $filterData, string $parameterSuffix): QueryBuilder { $newsletters = (array)$filterData->getParam('newsletters'); $operator = $filterData->getParam('operator') ?? DynamicSegmentFilterData::OPERATOR_ANY; $subscribersTable = $this->filterHelper->getSubscribersTable(); $statisticsNewslettersTable = $this->entityManager->getClassMetadata(StatisticsNewsletterEntity::class)->getTableName(); if ($operator === DynamicSegmentFilterData::OPERATOR_NONE) { $queryBuilder->leftJoin( $this->filterHelper->getSubscribersTable(), $statisticsNewslettersTable, 'statisticsNewsletter', "$subscribersTable.id = statisticsNewsletter.subscriber_id AND statisticsNewsletter.newsletter_id IN (:newsletters" . $parameterSuffix . ')' ) ->setParameter('newsletters' . $parameterSuffix, $newsletters, Connection::PARAM_INT_ARRAY) ->andWhere('statisticsNewsletter.subscriber_id IS NULL'); } else { $queryBuilder->innerJoin( $subscribersTable, $statisticsNewslettersTable, 'statisticsNewsletter', "statisticsNewsletter.subscriber_id = $subscribersTable.id AND statisticsNewsletter.newsletter_id IN (:newsletters" . $parameterSuffix . ')' )->setParameter('newsletters' . $parameterSuffix, $newsletters, Connection::PARAM_INT_ARRAY); if ($operator === DynamicSegmentFilterData::OPERATOR_ALL) { $queryBuilder->groupBy('subscriber_id'); $queryBuilder->having('COUNT(1) = ' . count($newsletters)); } } return $queryBuilder; } public function getLookupData(DynamicSegmentFilterData $filterData): array { $lookupData = [ 'newsletters' => [], 'links' => [], ]; $newsletterIds = $filterData->getParam('newsletters'); if (!is_array($newsletterIds)) { $newsletterIds = []; } // Clicked action only supports single newsletter ID $singularNewsletterId = $filterData->getParam('newsletter_id'); if (!is_null($singularNewsletterId)) { $newsletterIds[] = $singularNewsletterId; } $linkIds = $filterData->getParam('link_ids'); if (!is_array($linkIds)) { $linkIds = []; } foreach ($newsletterIds as $newsletterId) { $newsletter = $this->newslettersRepository->findOneById($newsletterId); if ($newsletter instanceof NewsletterEntity) { $lookupData['newsletters'][$newsletterId] = $newsletter->getSubject(); } } foreach ($linkIds as $linkId) { $link = $this->newsletterLinkRepository->findOneById($linkId); if ($link instanceof NewsletterLinkEntity) { $lookupData['links'][$linkId] = $link->getUrl(); } } return $lookupData; } }
Fatal error: Uncaught Error: Class "MailPoet\Segments\DynamicSegments\Filters\EmailAction" not found in /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php:4388 Stack trace: #0 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(4348): MailPoetGenerated\FreeCachedContainer->getEmailActionService() #1 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(4141): MailPoetGenerated\FreeCachedContainer->getFilterFactoryService() #2 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(4031): MailPoetGenerated\FreeCachedContainer->getSendingQueuesRepositoryService() #3 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(5088): MailPoetGenerated\FreeCachedContainer->getRenderer6Service() #4 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(5098): MailPoetGenerated\FreeCachedContainer->getConfirmationEmailCustomizerService() #5 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(5198): MailPoetGenerated\FreeCachedContainer->getConfirmationEmailMailerService() #6 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(5368): MailPoetGenerated\FreeCachedContainer->getSubscriberActionsService() #7 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(2612): MailPoetGenerated\FreeCachedContainer->getCommentService() #8 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(2640): MailPoetGenerated\FreeCachedContainer->getHooks2Service() #9 /htdocs/wp-content/plugins/mailpoet/vendor-prefixed/symfony/dependency-injection/Container.php(122): MailPoetGenerated\FreeCachedContainer->getInitializerService() #10 /htdocs/wp-content/plugins/mailpoet/vendor-prefixed/symfony/dependency-injection/Container.php(110): MailPoetVendor\Symfony\Component\DependencyInjection\Container->make('MailPoet\\Config...', 1) #11 /htdocs/wp-content/plugins/mailpoet/lib/DI/ContainerWrapper.php(39): MailPoetVendor\Symfony\Component\DependencyInjection\Container->get('MailPoet\\Config...') #12 /htdocs/wp-content/plugins/mailpoet/mailpoet_initializer.php(89): MailPoet\DI\ContainerWrapper->get('MailPoet\\Config...') #13 /htdocs/wp-content/plugins/mailpoet/mailpoet.php(194): require_once('/htdocs/wp-cont...') #14 /htdocs/wp-settings.php(526): include_once('/htdocs/wp-cont...') #15 /htdocs/wp-config.php(85): require_once('/htdocs/wp-sett...') #16 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #17 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #18 /htdocs/index.php(17): require('/htdocs/wp-blog...') #19 {main} thrown in /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php on line 4388