MailPoet\EmailEditor\Engine
Email_Editor::load_email_preview_template()
Use a custom page template for the email editor frontend rendering.
Method of the class: Email_Editor{}
No Hooks.
Return
String
.
Usage
$Email_Editor = new Email_Editor(); $Email_Editor->load_email_preview_template( $template );
- $template(string) (required)
- post template.
Email_Editor::load_email_preview_template() Email Editor::load email preview template code WC 9.8.1
public function load_email_preview_template( $template ) { $post = $this->get_current_post(); if ( ! $post instanceof \WP_Post ) { return $template; } $current_post_type = $post->post_type; $email_post_types = array_column( $this->get_post_types(), 'name' ); if ( ! in_array( $current_post_type, $email_post_types, true ) ) { return $template; } add_filter( 'mailpoet_email_editor_preview_post_template_html', function () use ( $post ) { // Generate HTML content for email editor post. return $this->send_preview_email->render_html( $post ); } ); return __DIR__ . '/Templates/single-email-post-template.php'; }