Identify all triggers with "woocommerce:" key prefix as WooCommerce triggers

[MAILPOET-5725]
This commit is contained in:
Jan Jakes
2024-01-31 16:32:29 +01:00
committed by Aschepikov
parent d5d20d5219
commit a17fc5e963

View File

@@ -293,7 +293,7 @@ class SendEmailAction implements Action {
return (bool)array_filter( return (bool)array_filter(
$automation->getTriggers(), $automation->getTriggers(),
function(Step $step): bool { function(Step $step): bool {
return in_array($step->getKey(), ['woocommerce:order-status-changed', 'woocommerce:abandoned-cart'], true); return strpos($step->getKey(), 'woocommerce:') === 0;
} }
); );
} }