Automattic\WooCommerce\Internal\Admin\EmailPreview

EmailPreview::render_legacy_preview_email()privateWC 1.0

Get HTML of the legacy preview email.

Method of the class: EmailPreview{}

Hooks from the method

Return

String.

Usage

// private - for code of main (parent) class only
$result = $this->render_legacy_preview_email();

EmailPreview::render_legacy_preview_email() code WC 9.7.1

private function render_legacy_preview_email() {
	// load the mailer class.
	$mailer = WC()->mailer();

	// get the preview email subject.
	$email_heading = __( 'HTML email template', 'woocommerce' );

	// get the preview email content.
	ob_start();
	include WC()->plugin_path() . '/includes/admin/views/html-email-template-preview.php';
	$message = ob_get_clean();

	// create a new email.
	$email = new WC_Email();

	/**
	 * Wrap the content with the email template and then add styles.
	 *
	 * @since 2.6.0
	 */
	return apply_filters( 'woocommerce_mail_content', $email->style_inline( $mailer->wrap_message( $email_heading, $message ) ) );
}