ository->getStandardNewsletterListWithMultipleStatuses(10), $campaignType ); } public function getPostNotificationNewsletters($campaignType): array { return $this->getNewsletterTypeLists( // fetch the most recently sent post-notification history newsletters limited to ten $this->newsletterRepository->getNotificationHistoryItems(10), $campaignType ); } public function getAutomations($campaignType): array { $result = []; // Fetch Automation stats within the last 90 days $primaryAfter = new \DateTimeImmutable((string)Carbon::now()->subDays(90)->toISOString()); $primaryBefore = new \DateTimeImmutable((string)Carbon::now()->toISOString()); $now = new \DateTimeImmutable(''); $query = new QueryWithCompare($primaryAfter, $primaryBefore, $now, $now); $userCurrency = $this->woocommerceHelper->getWoocommerceCurrency(); foreach ($this->automationStorage->getAutomations([Automation::STATUS_ACTIVE]) as $automation) { $automationId = (string)$automation->getId(); $automationStatistics = $this->overviewStatisticsController->getStatisticsForAutomation($automation, $query); $result[] = [ 'id' => $automationId, 'name' => $automation->getName(), 'campaignType' => $campaignType, 'url' => admin_url('admin.php?page=' . Menu::AUTOMATION_ANALYTICS_PAGE_SLUG . '&id=' . $automationId), 'price' => [ 'amount' => isset($automationStatistics['revenue']['current']) ? $this->formatPrice($automationStatistics['revenue']['current']) : 0, 'currency' => $userCurrency, ], ]; } return $result; } private function getNewsletterTypeLists($allNewsletters, $campaignType): array { $result = []; $userCurrency = $this->woocommerceHelper->getWoocommerceCurrency(); // fetch the most recent newsletters limited to ten foreach ($allNewsletters as $newsletter) { $newsLetterId = (string)$newsletter->getId(); /** @var ?WooCommerceRevenue $wooRevenue */ $wooRevenue = $this->newsletterStatisticsRepository->getWooCommerceRevenue($newsletter); $result[] = [ 'id' => $newsLetterId, 'name' => $newsletter->getSubject(), 'campaignType' => $campaignType, 'url' => admin_url('admin.php?page=' . Menu::EMAILS_PAGE_SLUG . '/#/stats/' . $newsLetterId), 'price' => [ 'amount' => $wooRevenue ? $this->formatPrice($wooRevenue->getValue()) : 0, 'currency' => $userCurrency, ], ]; } return $result; } /** * Format amount to 2 dp * @param string|int|float $amount * @return string */ private function formatPrice($amount): string { return number_format((float)$amount, 2, '.', ''); } }
Fatal error: Uncaught Error: Class "MailPoet\WooCommerce\MultichannelMarketing\MPMarketingChannelDataController" not found in /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php:5672 Stack trace: #0 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(5662): MailPoetGenerated\FreeCachedContainer->getMPMarketingChannelDataControllerService() #1 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(2622): MailPoetGenerated\FreeCachedContainer->getMPMarketingChannelControllerService() #2 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(2612): MailPoetGenerated\FreeCachedContainer->getHooksWooCommerceService() #3 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(2640): MailPoetGenerated\FreeCachedContainer->getHooks2Service() #4 /htdocs/wp-content/plugins/mailpoet/vendor-prefixed/symfony/dependency-injection/Container.php(122): MailPoetGenerated\FreeCachedContainer->getInitializerService() #5 /htdocs/wp-content/plugins/mailpoet/vendor-prefixed/symfony/dependency-injection/Container.php(110): MailPoetVendor\Symfony\Component\DependencyInjection\Container->make('MailPoet\\Config...', 1) #6 /htdocs/wp-content/plugins/mailpoet/lib/DI/ContainerWrapper.php(39): MailPoetVendor\Symfony\Component\DependencyInjection\Container->get('MailPoet\\Config...') #7 /htdocs/wp-content/plugins/mailpoet/mailpoet_initializer.php(89): MailPoet\DI\ContainerWrapper->get('MailPoet\\Config...') #8 /htdocs/wp-content/plugins/mailpoet/mailpoet.php(194): require_once('/htdocs/wp-cont...') #9 /htdocs/wp-settings.php(526): include_once('/htdocs/wp-cont...') #10 /htdocs/wp-config.php(85): require_once('/htdocs/wp-sett...') #11 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #12 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #13 /htdocs/index.php(17): require('/htdocs/wp-blog...') #14 {main} thrown in /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php on line 5672