tcode $body = (string)str_replace( '[lists_to_confirm]', join(', ', $segmentNames), $stringBody ); // replace activation link $body = (string)str_replace( [ 'http://[activation_link]', // See MAILPOET-5253 '[activation_link]', ], $this->subscriptionUrlFactory->getConfirmationUrl($subscriber), $body ); [ $html, $text, $subject, ] = Helpers::splitObject(Shortcodes::process($body, null, $newsletter, $subscriber, null)); return $this->buildEmailData($subject, $html, $text); } /** * @throws \Exception if unable to send the email. */ public function sendConfirmationEmail(SubscriberEntity $subscriber) { $signupConfirmation = $this->settings->get('signup_confirmation'); if ((bool)$signupConfirmation['enabled'] === false) { return false; } if (!$this->wp->isUserLoggedIn() && $subscriber->getConfirmationsCount() >= self::MAX_CONFIRMATION_EMAILS) { return false; } $authorizationEmailsValidation = $this->settings->get(AuthorizedEmailsController::AUTHORIZED_EMAIL_ADDRESSES_ERROR_SETTING); $unauthorizedSenderEmail = isset($authorizationEmailsValidation['invalid_sender_address']); if (Bridge::isMPSendingServiceEnabled() && $unauthorizedSenderEmail) { return false; } $segments = $subscriber->getSegments()->toArray(); $segmentNames = array_map(function(SegmentEntity $segment) { return $segment->getName(); }, $segments); $IsConfirmationEmailCustomizerEnabled = (bool)$this->settings->get(ConfirmationEmailCustomizer::SETTING_ENABLE_EMAIL_CUSTOMIZER, false); $email = $IsConfirmationEmailCustomizerEnabled ? $this->getMailBodyWithCustomizer($subscriber, $segmentNames) : $this->getMailBody($signupConfirmation, $subscriber, $segmentNames); // send email $extraParams = [ 'meta' => $this->mailerMetaInfo->getConfirmationMetaInfo($subscriber), ]; // Don't attempt to send confirmation email when sending is paused $confirmationEmailErrorMessage = __('There was an error when sending a confirmation email for your subscription. Please contact the website owner.', 'mailpoet'); if (MailerLog::isSendingPaused()) { throw new \Exception($confirmationEmailErrorMessage); } try { $defaultMailer = $this->mailerFactory->getDefaultMailer(); $result = $defaultMailer->send($email, $subscriber, $extraParams); } catch (\Exception $e) { MailerLog::processTransactionalEmailError(MailerError::OPERATION_CONNECT, $e->getMessage(), $e->getCode()); throw new \Exception($confirmationEmailErrorMessage); } if ($result['response'] === false) { if ($result['error'] instanceof MailerError && $result['error']->getLevel() === MailerError::LEVEL_HARD) { MailerLog::processTransactionalEmailError($result['error']->getOperation(), (string)$result['error']->getMessage()); } throw new \Exception($confirmationEmailErrorMessage); }; // E-mail was successfully sent we need to update the MailerLog MailerLog::incrementSentCount(); if (!$this->wp->isUserLoggedIn()) { $subscriber->setConfirmationsCount($subscriber->getConfirmationsCount() + 1); $this->subscribersRepository->persist($subscriber); $this->subscribersRepository->flush(); } $this->sentEmails[$subscriber->getId()] = true; return true; } }
Fatal error: Uncaught Error: Class "MailPoet\Subscribers\ConfirmationEmailMailer" not found in /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php:5098 Stack trace: #0 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(5198): MailPoetGenerated\FreeCachedContainer->getConfirmationEmailMailerService() #1 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(5368): MailPoetGenerated\FreeCachedContainer->getSubscriberActionsService() #2 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(2612): MailPoetGenerated\FreeCachedContainer->getCommentService() #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 5098