WC_Email_Order_Withdrawal_Requested::get_headers │ public │ WC 1.0

Get email headers.

Method of the class: WC_Email_Order_Withdrawal_Requested{}

Hooks from the method

Returns

string.

Usage

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

WC_Email_Order_Withdrawal_Requested::get_headers() code WC 11.2.1

public function get_headers() {
	$headers = 'Content-Type: ' . $this->get_content_type() . "\r\n";
	$name    = $this->formatter->get_customer_name( $this->withdrawal_data );
	$email   = $this->withdrawal_data[ OrderWithdrawalFormProcessor::FIELD_EMAIL ] ?? '';

	if ( '' !== $name && is_email( $email ) ) {
		$headers .= 'Reply-to: ' . sanitize_text_field( $name ) . ' <' . sanitize_email( $email ) . ">\r\n";
	}

	if ( FeaturesUtil::feature_is_enabled( 'email_improvements' ) ) {
		$cc = $this->get_cc_recipient();
		if ( ! empty( $cc ) ) {
			$headers .= 'Cc: ' . sanitize_text_field( $cc ) . "\r\n";
		}

		$bcc = $this->get_bcc_recipient();
		if ( ! empty( $bcc ) ) {
			$headers .= 'Bcc: ' . sanitize_text_field( $bcc ) . "\r\n";
		}
	}

	/**
	 * Filter the email headers.
	 *
	 * @since 2.0.0
	 * @param string   $headers Email headers.
	 * @param string   $email_id Email ID.
	 * @param object|bool $object Email object.
	 * @param WC_Email $email    Email instance.
	 */
	return apply_filters( 'woocommerce_email_headers', $headers, $this->id, $this->object, $this );
}