WC_Email_Order_Withdrawal_Requested::trigger │ public │ WC 1.0

Trigger the sending of this email.

Method of the class: WC_Email_Order_Withdrawal_Requested{}

No Hooks.

Returns

bool. Whether the email was sent successfully.

Usage

$WC_Email_Order_Withdrawal_Requested = new WC_Email_Order_Withdrawal_Requested();
$WC_Email_Order_Withdrawal_Requested->trigger( $data, ?WC_Order $matched_order, $submitted_at, $outside_withdrawal_window, $withdrawal_window_warning ): bool;
$data(array<string,mixed>) (required)
Form data.
?WC_Order $matched_order(required)
.
$submitted_at(int) (required)
Unix timestamp for the submission.
$outside_withdrawal_window(true|false) (required)
Whether the matched order is outside the withdrawal window.
$withdrawal_window_warning(string) (required)
Withdrawal window warning message.

WC_Email_Order_Withdrawal_Requested::trigger() code WC 11.3.0

public function trigger( array $data, ?WC_Order $matched_order, int $submitted_at, bool $outside_withdrawal_window, string $withdrawal_window_warning ): bool {
	$this->setup_locale();

	$data = $this->formatter->normalize_withdrawal_data( $data );

	if ( null === $data ) {
		$this->restore_locale();

		return false;
	}

	$this->object                               = $matched_order ? $matched_order : (object) $data;
	$this->withdrawal_data                      = $data;
	$this->matched_order                        = $matched_order;
	$this->submitted_at                         = $submitted_at;
	$this->outside_withdrawal_window            = $outside_withdrawal_window;
	$this->withdrawal_window_warning            = $withdrawal_window_warning;
	$this->placeholders['{order_number}']       = $data[ OrderWithdrawalFormProcessor::FIELD_ORDER_NUMBER ];
	$this->placeholders['{order_billing_name}'] = $this->formatter->get_customer_name( $data );

	$sent = $this->send_notification();

	$this->restore_locale();

	return $sent;
}