Automattic\WooCommerce\Internal\Admin\EmailPreview
EmailPreview::render_legacy_preview_email()
Get HTML of the legacy preview email.
Метод класса: EmailPreview{}
Хуки из метода
Возвращает
Строку
.
Использование
// private - только в коде основоного (родительского) класса $result = $this->render_legacy_preview_email();
Код EmailPreview::render_legacy_preview_email() EmailPreview::render legacy preview email WC 9.6.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 ) ) ); }