Suppressing the Carrier
How to disable the Carrier process on the fly
If you want to suppress a specific Carrier you can do it like this:
use BracketSpace\Notification\Repository\Carrier\Email;
add_action(
'notification/carrier/pre-send',
function($carrier, $trigger, $notification)
{
if ($carrier instanceof Email::class) {
$carrier->suppress();
}
},
10,
3
);
Last updated