WC_Email::get_headers()publicWC 1.0

Get email headers.

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

Хуки из метода

Возвращает

Строку.

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

$WC_Email = new WC_Email();
$WC_Email->get_headers();

Код WC_Email::get_headers() WC 8.7.0

public function get_headers() {
	$header = 'Content-Type: ' . $this->get_content_type() . "\r\n";

	if ( in_array( $this->id, array( 'new_order', 'cancelled_order', 'failed_order' ), true ) ) {
		if ( $this->object && $this->object->get_billing_email() && ( $this->object->get_billing_first_name() || $this->object->get_billing_last_name() ) ) {
			$header .= 'Reply-to: ' . $this->object->get_billing_first_name() . ' ' . $this->object->get_billing_last_name() . ' <' . $this->object->get_billing_email() . ">\r\n";
		}
	} elseif ( $this->get_from_address() && $this->get_from_name() ) {
		$header .= 'Reply-to: ' . $this->get_from_name() . ' <' . $this->get_from_address() . ">\r\n";
	}

	return apply_filters( 'woocommerce_email_headers', $header, $this->id, $this->object, $this );
}