WC_Email::get_headers()
Get email headers.
Method of the class: WC_Email{}
Hooks from the method
Return
String
.
Usage
$WC_Email = new WC_Email(); $WC_Email->get_headers();
WC_Email::get_headers() WC Email::get headers code WC 9.8.2
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"; } if ( FeaturesUtil::feature_is_enabled( 'email_improvements' ) ) { $cc = $this->get_cc_recipient(); if ( ! empty( $cc ) ) { $header .= 'Cc: ' . sanitize_text_field( $cc ) . "\r\n"; } $bcc = $this->get_bcc_recipient(); if ( ! empty( $bcc ) ) { $header .= 'Bcc: ' . sanitize_text_field( $bcc ) . "\r\n"; } } return apply_filters( 'woocommerce_email_headers', $header, $this->id, $this->object, $this ); }