Send transactional emails with order created/completed/cancelled triggers
[MAILPOET-5725]
This commit is contained in:
@@ -33,6 +33,13 @@ use Throwable;
|
|||||||
class SendEmailAction implements Action {
|
class SendEmailAction implements Action {
|
||||||
const KEY = 'mailpoet:send-email';
|
const KEY = 'mailpoet:send-email';
|
||||||
|
|
||||||
|
private const TRANSACTIONAL_TRIGGERS = [
|
||||||
|
'woocommerce:order-status-changed',
|
||||||
|
'woocommerce:order-created',
|
||||||
|
'woocommerce:order-completed',
|
||||||
|
'woocommerce:order-cancelled',
|
||||||
|
];
|
||||||
|
|
||||||
/** @var SettingsController */
|
/** @var SettingsController */
|
||||||
private $settings;
|
private $settings;
|
||||||
|
|
||||||
@@ -266,7 +273,7 @@ class SendEmailAction implements Action {
|
|||||||
$transactionalTriggers = array_filter(
|
$transactionalTriggers = array_filter(
|
||||||
$triggers,
|
$triggers,
|
||||||
function(Step $step): bool {
|
function(Step $step): bool {
|
||||||
return in_array($step->getKey(), ['woocommerce:order-status-changed'], true);
|
return in_array($step->getKey(), self::TRANSACTIONAL_TRIGGERS, true);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user