Automattic\WooCommerce\Internal\Orders

PointOfSaleEmailHandler::maybe_suppress_emailpublicWC 1.0

Suppress email if the order was paid at POS.

Method of the class: PointOfSaleEmailHandler{}

No Hooks.

Returns

true|false. False if the order was paid at POS, original value otherwise.

Usage

$PointOfSaleEmailHandler = new PointOfSaleEmailHandler();
$PointOfSaleEmailHandler->maybe_suppress_email( $enabled, $order ): bool;
$enabled(true|false) (required)
Whether the email is enabled.
$order(mixed) (required)
The order object (or null).

PointOfSaleEmailHandler::maybe_suppress_email() code WC 10.7.0

public function maybe_suppress_email( bool $enabled, $order ): bool {
	if ( ! $order instanceof WC_Abstract_Order ) {
		return $enabled;
	}

	if ( PointOfSaleOrderUtil::is_order_paid_at_pos( $order ) ) {
		return false;
	}

	return $enabled;
}