diff --git a/mailpoet/lib/Automation/API/API.php b/mailpoet/lib/Automation/API/API.php index fe798d7eca..efbc4bc4af 100644 --- a/mailpoet/lib/Automation/API/API.php +++ b/mailpoet/lib/Automation/API/API.php @@ -2,6 +2,7 @@ namespace MailPoet\Automation\API; +use MailPoet\Automation\API\Endpoints\WorkflowsEndpoint; use MailPoet\Automation\Exceptions\Exception; use MailPoet\Automation\WordPress; use ReflectionClass; @@ -20,6 +21,7 @@ class API { /** @var array> */ private $routes = [ + 'workflows' => WorkflowsEndpoint::class, ]; public function __construct( diff --git a/mailpoet/lib/Automation/API/Endpoints/WorkflowsEndpoint.php b/mailpoet/lib/Automation/API/Endpoints/WorkflowsEndpoint.php new file mode 100644 index 0000000000..961c6ec548 --- /dev/null +++ b/mailpoet/lib/Automation/API/Endpoints/WorkflowsEndpoint.php @@ -0,0 +1,13 @@ + 'Hello world.']); + } +} diff --git a/mailpoet/lib/DI/ContainerConfigurator.php b/mailpoet/lib/DI/ContainerConfigurator.php index 0f715ab187..0f3c0c81ed 100644 --- a/mailpoet/lib/DI/ContainerConfigurator.php +++ b/mailpoet/lib/DI/ContainerConfigurator.php @@ -105,6 +105,7 @@ class ContainerConfigurator implements IContainerConfigurator { $container->autowire(\MailPoet\Automation\API\EndpointFactory::class) ->setPublic(true) ->setArgument('$container', new Reference(ContainerWrapper::class)); + $container->autowire(\MailPoet\Automation\API\Endpoints\WorkflowsEndpoint::class)->setPublic(true); $container->autowire(\MailPoet\Automation\Automation::class)->setPublic(true); $container->autowire(\MailPoet\Automation\WordPress::class)->setPublic(true); // Config