diff --git a/mailpoet/lib/Features/FeaturesController.php b/mailpoet/lib/Features/FeaturesController.php index 61aae93e32..8d3177efab 100644 --- a/mailpoet/lib/Features/FeaturesController.php +++ b/mailpoet/lib/Features/FeaturesController.php @@ -7,14 +7,12 @@ use MailPoetVendor\Doctrine\DBAL\Exception\TableNotFoundException; class FeaturesController { const FEATURE_BRAND_TEMPLATES = 'brand_templates'; const GUTENBERG_EMAIL_EDITOR = 'gutenberg_email_editor'; - const MAILPOET_WOOCOMMERCE_MULTICHANNEL_INTEGRATION = 'mailpoet_woocommerce_multichannel_integration'; // Define feature defaults in the array below in the following form: // self::FEATURE_NAME_OF_FEATURE => true, private $defaults = [ self::FEATURE_BRAND_TEMPLATES => false, self::GUTENBERG_EMAIL_EDITOR => false, - self::MAILPOET_WOOCOMMERCE_MULTICHANNEL_INTEGRATION => false, ]; /** @var array|null */ diff --git a/mailpoet/lib/WooCommerce/MultichannelMarketing/MPMarketingChannelController.php b/mailpoet/lib/WooCommerce/MultichannelMarketing/MPMarketingChannelController.php index 34d11a7763..3bb3f8afc9 100644 --- a/mailpoet/lib/WooCommerce/MultichannelMarketing/MPMarketingChannelController.php +++ b/mailpoet/lib/WooCommerce/MultichannelMarketing/MPMarketingChannelController.php @@ -2,31 +2,20 @@ namespace MailPoet\WooCommerce\MultichannelMarketing; -use MailPoet\Features\FeaturesController; - class MPMarketingChannelController { - /** @var FeaturesController */ - private $featuresController; - /** * @var MPMarketingChannelDataController */ private $channelDataController; public function __construct( - FeaturesController $featuresController, MPMarketingChannelDataController $channelDataController ) { - $this->featuresController = $featuresController; $this->channelDataController = $channelDataController; } public function registerMarketingChannel($registeredMarketingChannels): array { - if (!$this->featuresController->isSupported(FeaturesController::MAILPOET_WOOCOMMERCE_MULTICHANNEL_INTEGRATION)) { - return $registeredMarketingChannels; // Do not register the marketing channel if the feature flag is not enabled - } - return array_merge($registeredMarketingChannels, [ new MPMarketingChannel( $this->channelDataController diff --git a/mailpoet/lib/WooCommerce/MultichannelMarketing/MPMarketingChannelDataController.php b/mailpoet/lib/WooCommerce/MultichannelMarketing/MPMarketingChannelDataController.php index 0b106c49f7..b748a9157e 100644 --- a/mailpoet/lib/WooCommerce/MultichannelMarketing/MPMarketingChannelDataController.php +++ b/mailpoet/lib/WooCommerce/MultichannelMarketing/MPMarketingChannelDataController.php @@ -141,6 +141,7 @@ class MPMarketingChannelDataController { public function getStandardNewsletterList($campaignType): array { return $this->getNewsletterTypeLists( + // fetch the most recently sent post-notification history newsletters limited to ten $this->newsletterRepository->getStandardNewsletterListWithMultipleStatuses(10), $campaignType ); diff --git a/mailpoet/tests/acceptance/WooCommerce/MPMarketingChannelCest.php b/mailpoet/tests/acceptance/WooCommerce/MPMarketingChannelCest.php index 2f262df51a..06374156f6 100644 --- a/mailpoet/tests/acceptance/WooCommerce/MPMarketingChannelCest.php +++ b/mailpoet/tests/acceptance/WooCommerce/MPMarketingChannelCest.php @@ -2,9 +2,7 @@ namespace MailPoet\Test\Acceptance; -use MailPoet\Features\FeaturesController; use MailPoet\Mailer\Mailer; -use MailPoet\Test\DataFactories\Features; use MailPoet\Test\DataFactories\Newsletter; use MailPoet\Test\DataFactories\Settings; @@ -26,7 +24,6 @@ class MPMarketingChannelCest { public function itShowsMailPoetSetup(\AcceptanceTester $i) { $this->settingsFactory->withWelcomeWizard(); - (new Features())->withFeatureEnabled(FeaturesController::MAILPOET_WOOCOMMERCE_MULTICHANNEL_INTEGRATION); $i->login(); $i->amOnPage('/wp-admin/admin.php?page=wc-admin&path=%2Fmarketing'); @@ -40,7 +37,6 @@ class MPMarketingChannelCest { public function itShowsErrorCount(\AcceptanceTester $i) { (new Newsletter())->create(); - (new Features())->withFeatureEnabled(FeaturesController::MAILPOET_WOOCOMMERCE_MULTICHANNEL_INTEGRATION); $i->login(); @@ -57,7 +53,6 @@ class MPMarketingChannelCest { public function itShowsMailPoetSyncStatus(\AcceptanceTester $i) { (new Newsletter())->create(); - (new Features())->withFeatureEnabled(FeaturesController::MAILPOET_WOOCOMMERCE_MULTICHANNEL_INTEGRATION); $i->login(); @@ -71,7 +66,6 @@ class MPMarketingChannelCest { public function itShowsMailPoetSyncStatusWithErrorCount(\AcceptanceTester $i) { (new Newsletter())->create(); - (new Features())->withFeatureEnabled(FeaturesController::MAILPOET_WOOCOMMERCE_MULTICHANNEL_INTEGRATION); $i->login(); @@ -86,8 +80,6 @@ class MPMarketingChannelCest { } public function itCanCreateMailPoetCampaigns(\AcceptanceTester $i) { - (new Features())->withFeatureEnabled(FeaturesController::MAILPOET_WOOCOMMERCE_MULTICHANNEL_INTEGRATION); - $i->login(); $i->amOnPage('/wp-admin/admin.php?page=wc-admin&path=%2Fmarketing');