Dev Resources

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

WC_Email::__construct()

Constructor.

Contents

  • Description
    • Source
  • Related
    • Uses
    • Used By
  • User Contributed Notes

Description #Description


Source #Source

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

	public function __construct() {
		// Find/replace.
		$this->placeholders = array_merge(
			array(
				'{site_title}'   => $this->get_blogname(),
				'{site_address}' => wp_parse_url( home_url(), PHP_URL_HOST ),
				'{site_url}'     => wp_parse_url( home_url(), PHP_URL_HOST ),
			),
			$this->placeholders
		);

		// Init settings.
		$this->init_form_fields();
		$this->init_settings();

		// Default template base if not declared in child constructor.
		if ( is_null( $this->template_base ) ) {
			$this->template_base = WC()->plugin_path() . '/templates/';
		}

		$this->email_type = $this->get_option( 'email_type' );
		$this->enabled    = $this->get_option( 'enabled' );

		add_action( 'phpmailer_init', array( $this, 'handle_multipart' ) );
		add_action( 'woocommerce_update_options_email_' . $this->id, array( $this, 'process_admin_options' ) );
	}

Expand full source code Collapse full source code


Top ↑

Related #Related

Top ↑

Uses #Uses

Uses
Uses Description
woocommerce.php: WC()

Returns the main instance of WC.

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

Initialise Settings Form Fields – these are generic email options most will use.

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

Get WordPress blog name.

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

Proxy to parent’s get_option and attempt to localize the result using gettext.

Top ↑

Used By #Used By

Used By
Used By Description
packages/woocommerce-admin/src/Notes/MerchantEmailNotifications/NotificationEmail.php: NotificationEmail::__construct()

Constructor.

packages/woocommerce-blocks/src/Domain/Services/Email/CustomerNewAccount.php: CustomerNewAccount::__construct()

Constructor.

includes/emails/class-wc-email-new-order.php: WC_Email_New_Order::__construct()

Constructor.

includes/emails/class-wc-email-customer-completed-order.php: WC_Email_Customer_Completed_Order::__construct()

Constructor.

includes/emails/class-wc-email-cancelled-order.php: WC_Email_Cancelled_Order::__construct()

Constructor.

includes/emails/class-wc-email-customer-invoice.php: WC_Email_Customer_Invoice::__construct()

Constructor.

includes/emails/class-wc-email-customer-reset-password.php: WC_Email_Customer_Reset_Password::__construct()

Constructor.

includes/emails/class-wc-email-failed-order.php: WC_Email_Failed_Order::__construct()

Constructor.

includes/emails/class-wc-email-customer-new-account.php: WC_Email_Customer_New_Account::__construct()

Constructor.

includes/emails/class-wc-email-customer-note.php: WC_Email_Customer_Note::__construct()

Constructor.

includes/emails/class-wc-email-customer-on-hold-order.php: WC_Email_Customer_On_Hold_Order::__construct()

Constructor.

includes/emails/class-wc-email-customer-processing-order.php: WC_Email_Customer_Processing_Order::__construct()

Constructor.

includes/emails/class-wc-email-customer-refunded-order.php: WC_Email_Customer_Refunded_Order::__construct()

Constructor.

includes/admin/class-wc-admin.php: WC_Admin::preview_emails()

Preview email template.

includes/class-wc-emails.php: WC_Emails::send()

Send the email.

packages/woocommerce-admin/src/ReportCSVEmail.php: ReportCSVEmail::__construct()

Constructor.

Show 11 more used by Hide more used by

Top ↑

User Contributed Notes #User Contributed Notes

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

Proudly powered by WordPress