Automattic\WooCommerce\Internal\Admin\EmailImprovements

EmailImprovements::get_enabled_or_manual_emails_with_cc_or_bccpublic staticWC 1.0

Get all enabled or manual emails with Cc or Bcc.

Method of the class: EmailImprovements{}

No Hooks.

Returns

Array. Enabled or manual emails with Cc or Bcc.

Usage

$result = EmailImprovements::get_enabled_or_manual_emails_with_cc_or_bcc();

EmailImprovements::get_enabled_or_manual_emails_with_cc_or_bcc() code WC 10.7.0

public static function get_enabled_or_manual_emails_with_cc_or_bcc() {
	$enabled_or_manual_emails = array_filter(
		self::get_emails(),
		function ( $email ) {
			return $email->is_enabled() || $email->is_manual();
		}
	);

	$email_ids_with_cc  = array();
	$email_ids_with_bcc = array();

	foreach ( $enabled_or_manual_emails as $email ) {
		if ( $email->get_cc_recipient() ) {
			$email_ids_with_cc[] = get_class( $email );
		}
		if ( $email->get_bcc_recipient() ) {
			$email_ids_with_bcc[] = get_class( $email );
		}
	}

	return array(
		'ccs'  => $email_ids_with_cc,
		'bccs' => $email_ids_with_bcc,
	);
}