mailpoetPremiumIntegration = $mailpoetPremiumIntegration; $this->wordPressIntegration = $wordPressIntegration; $this->wooCommerceIntegration = $wooCommerceIntegration; $this->wooCommerceSubscriptionsIntegration = $wooCommerceSubscriptionsIntegration; $this->wp = $wp; } public function initialize(): void { $this->wp->addAction( AutomationHooks::API_INITIALIZE, [$this, 'registerPremiumAutomationAPIRoutes'], 5 // register premium routes before the free ones to replace the same ones ); $this->wp->addAction(AutomationHooks::INITIALIZE, function($registry) { $this->mailpoetPremiumIntegration->register($registry); $this->wordPressIntegration->register($registry); $this->wooCommerceIntegration->register($registry); $this->wooCommerceSubscriptionsIntegration->register($registry); }); } public function registerPremiumAutomationAPIRoutes(API $api): void { $api->registerPostRoute('automations', AutomationsPostEndpoint::class); $api->registerPutRoute('automations/(?P\d+)', AutomationsPutEndpoint::class); } }