Dev Resources

  • Home
  • Reference
  • BuddyX Theme
  • Functions
  • Hooks
  • Classes
Filter by type:
Search
Browse: Home / Reference / Classes / WC_Email / WC_Email::get_headers()

WC_Email::get_headers()

Get email headers.

Contents

  • Description
    • Return
    • Source
  • Related
    • Uses
  • User Contributed Notes

Description #Description


Return #Return

(string)


Top ↑

Source #Source

File: includes/emails/class-wc-email.php

	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 );
	}

Expand full source code Collapse full source code


Top ↑

Related #Related

Top ↑

Uses #Uses

Uses
Uses Description
packages/woocommerce-admin/src/Notes/MerchantEmailNotifications/NotificationEmail.php: woocommerce_email_headers

Include dependencies.

includes/emails/class-wc-email.php: WC_Email::get_from_address()

Get the from address for outgoing emails.

includes/emails/class-wc-email.php: WC_Email::get_from_name()

Get the from name for outgoing emails.

includes/emails/class-wc-email.php: WC_Email::get_content_type()

Get email content type.


Top ↑

User Contributed Notes #User Contributed Notes

You must log in before being able to contribute a note or feedback.

Proudly powered by WordPress