Automattic\WooCommerce\Internal\OrderWithdrawal

OrderWithdrawalFormProcessor::get_merchant_email_headers │ private │ WC 1.0

Get merchant email headers.

Method of the class: OrderWithdrawalFormProcessor{}

No Hooks.

Returns

string.

Usage

// private - for code of main (parent) class only
$result = $this->get_merchant_email_headers( $data ): string;
$data(array<string,string>) (required)
Form data.

OrderWithdrawalFormProcessor::get_merchant_email_headers() code WC 11.1.2

private function get_merchant_email_headers( array $data ): string {
	$headers = array( 'Content-Type: text/html; charset=UTF-8' );
	$name    = $this->get_customer_name( $data );
	$email   = $data[ self::FIELD_EMAIL ];

	if ( '' !== $name && is_email( $email ) ) {
		$headers[] = sprintf( 'Reply-To: %1$s <%2$s>', $name, $email );
	}

	return implode( "\r\n", $headers );
}