etDeletedAt() !== null) { return; } } if ($newsletter->getOptionValue(NewsletterOptionFieldEntity::NAME_EVENT) === 'user') { $segment = $this->segmentsRepository->getWPUsersSegment(); if ((!$segment instanceof SegmentEntity) || $segment->getDeletedAt() !== null) { return; } } $previouslyScheduledNotification = $this->scheduledTasksRepository->findByNewsletterAndSubscriberId($newsletter, $subscriberId); if (!empty($previouslyScheduledNotification)) { return; } // task $task = new ScheduledTaskEntity(); $task->setType(SendingQueue::TASK_TYPE); $task->setStatus(ScheduledTaskEntity::STATUS_SCHEDULED); $task->setPriority(ScheduledTaskEntity::PRIORITY_HIGH); $task->setScheduledAt($this->scheduler->getScheduledTimeWithDelay( $newsletter->getOptionValue(NewsletterOptionFieldEntity::NAME_AFTER_TIME_TYPE), $newsletter->getOptionValue(NewsletterOptionFieldEntity::NAME_AFTER_TIME_NUMBER) )); $this->entityManager->persist($task); // queue $queue = new SendingQueueEntity(); $queue->setTask($task); $queue->setNewsletter($newsletter); // Because we changed the way how to updateCounts after sending we need to set initial counts $queue->setCountTotal(1); $queue->setCountToProcess(1); $task->setSendingQueue($queue); $this->entityManager->persist($queue); // task subscriber $taskSubscriber = new ScheduledTaskSubscriberEntity($task, $subscriber); $task->getSubscribers()->add($taskSubscriber); $this->entityManager->persist($taskSubscriber); $this->entityManager->flush(); } }
Fatal error: Uncaught Error: Class "MailPoet\Newsletter\Scheduler\WelcomeScheduler" not found in /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php:4091 Stack trace: #0 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(4808): MailPoetGenerated\FreeCachedContainer->getWelcomeSchedulerService() #1 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(2673): MailPoetGenerated\FreeCachedContainer->getWPService() #2 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(2578): MailPoetGenerated\FreeCachedContainer->getPopulatorService() #3 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(2640): MailPoetGenerated\FreeCachedContainer->getActivatorService() #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 4091