Automattic\WooCommerce\Internal\OrderWithdrawal

OrderWithdrawalFormProcessor::send_merchant_order_withdrawal_email │ private │ WC 1.0

Send the merchant order withdrawal notification email.

Method of the class: OrderWithdrawalFormProcessor{}

No Hooks.

Returns

null. Nothing (null).

Usage

// private - for code of main (parent) class only
$result = $this->send_merchant_order_withdrawal_email( $data, ?WC_Order $matched_order, $submitted_at ): bool;
$data(array<string,string>) (required)
Form data.
?WC_Order $matched_order(required)
.
$submitted_at(int) (required)
Unix timestamp for the submission.

OrderWithdrawalFormProcessor::send_merchant_order_withdrawal_email() code WC 11.2.1

private function send_merchant_order_withdrawal_email( array $data, ?WC_Order $matched_order, int $submitted_at ): bool {
	$email = WC()->mailer()->get_emails()['WC_Email_Order_Withdrawal_Requested'] ?? include WC_ABSPATH . 'includes/emails/class-wc-email-order-withdrawal-requested.php';

	if ( ! $email instanceof WC_Email_Order_Withdrawal_Requested ) {
		return false;
	}

	if ( ! $email->is_enabled() ) {
		return true;
	}

	return $email->trigger(
		$data,
		$matched_order,
		$submitted_at,
		$matched_order instanceof WC_Order && $this->is_order_outside_withdrawal_window( $matched_order ),
		$matched_order instanceof WC_Order ? $this->get_withdrawal_window_warning_message() : ''
	);
}