WC_Email_Customer_Order_Withdrawal_Requested::trigger │ public │ WC 1.0

Trigger the sending of this email.

Метод класса: WC_Email_Customer_Order_Withdrawal_Requested{}

Хуков нет.

Возвращает

bool. Whether the email was sent successfully.

Использование

$WC_Email_Customer_Order_Withdrawal_Requested = new WC_Email_Customer_Order_Withdrawal_Requested();
$WC_Email_Customer_Order_Withdrawal_Requested->trigger( $data, $submitted_at ): bool;
$data(array<string,mixed>) (обязательный)
Form data.
$submitted_at(int) (обязательный)
Unix timestamp for the submission.

Код WC_Email_Customer_Order_Withdrawal_Requested::trigger() WC 11.2.2

public function trigger( array $data, int $submitted_at ): bool {
	$this->setup_locale();

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

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

		return false;
	}

	$this->object                               = (object) $data;
	$this->withdrawal_data                      = $data;
	$this->submitted_at                         = $submitted_at;
	$this->recipient                            = $data[ OrderWithdrawalFormProcessor::FIELD_EMAIL ];
	$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;
}