Automattic\WooCommerce\Internal\StockNotifications\Emails

EmailManager::prepare_email_for_previewpublicWC 1.0

Prepares the email for preview.

Method of the class: EmailManager{}

No Hooks.

Returns

\WC_Email.

Usage

$EmailManager = new EmailManager();
$EmailManager->prepare_email_for_preview( $email );
$email(WC_Email) (required)
The email object being previewed.

EmailManager::prepare_email_for_preview() code WC 10.3.6

public function prepare_email_for_preview( $email ) {
	if ( ! in_array( $email->id, self::$email_ids, true ) ) {
		return $email;
	}

	$notification = Factory::create_dummy_notification();
	$email->prepare_email( $notification );

	return $email;
}