Add WooCommerce integration and order status trigger backend

[MAILPOET-4935]
This commit is contained in:
David Remer
2023-03-15 08:28:21 +02:00
committed by Aschepikov
parent e081c554aa
commit e140dc6d4e
12 changed files with 480 additions and 0 deletions

View File

@@ -8,6 +8,7 @@ use MailPoet\AutomaticEmails\AutomaticEmails;
use MailPoet\Automation\Engine\Engine;
use MailPoet\Automation\Engine\Hooks as AutomationHooks;
use MailPoet\Automation\Integrations\MailPoet\MailPoetIntegration;
use MailPoet\Automation\Integrations\WooCommerce\WooCommerceIntegration;
use MailPoet\Cron\CronTrigger;
use MailPoet\Cron\DaemonActionSchedulerRunner;
use MailPoet\InvalidStateException;
@@ -108,6 +109,9 @@ class Initializer {
/** @var MailPoetIntegration */
private $automationMailPoetIntegration;
/** @var WooCommerceIntegration */
private $woocommerceIntegration;
/** @var PersonalDataExporters */
private $personalDataExporters;
@@ -148,6 +152,7 @@ class Initializer {
AssetsLoader $assetsLoader,
Engine $automationEngine,
MailPoetIntegration $automationMailPoetIntegration,
WooCommerceIntegration $woocommerceIntegration,
PersonalDataExporters $personalDataExporters,
DaemonActionSchedulerRunner $actionSchedulerRunner,
Url $urlHelper
@@ -178,6 +183,7 @@ class Initializer {
$this->assetsLoader = $assetsLoader;
$this->automationEngine = $automationEngine;
$this->automationMailPoetIntegration = $automationMailPoetIntegration;
$this->woocommerceIntegration = $woocommerceIntegration;
$this->personalDataExporters = $personalDataExporters;
$this->actionSchedulerRunner = $actionSchedulerRunner;
$this->urlHelper = $urlHelper;
@@ -260,6 +266,10 @@ class Initializer {
$this->automationMailPoetIntegration,
'register',
]);
WPFunctions::get()->addAction(AutomationHooks::INITIALIZE, [
$this->woocommerceIntegration,
'register',
]);
WPFunctions::get()->addAction('admin_init', [
$this,