WooCommerce Code Reference

Email_Editor
in package

Email editor class.

Tags
phpstan-type

EmailPostType array{name: string, args: array, meta: array{key: string, args: array}[]} See register_post_type for details about EmailPostType args.

Table of Contents

MAILPOET_EMAIL_META_THEME_TYPE  = 'mailpoet_email_theme'
$email_api_controller  : Email_Api_Controller
Property for the email API controller.
$patterns  : Patterns
Property for the patterns.
$personalization_tags_registry  : Personalization_Tags_Registry
Property for Personalization_Tags_Controller that allows initializing personalization tags.
$send_preview_email  : Send_Preview_Email
Property for the send preview email controller.
$templates  : Templates
Property for the templates.
__construct()  : mixed
Constructor.
extend_email_post_api()  : void
Extends the email post types with email specific data.
extend_email_theme_styles()  : WP_Theme_JSON
Extends the email theme styles with the email specific styles.
get_current_post()  : array<string|int, mixed>|mixed|WP_Post|null
Get the current post object
initialize()  : void
Initialize the email editor.
load_email_preview_template()  : string
Use a custom page template for the email editor frontend rendering.
register_email_editor_api_routes()  : void
Registers the API route endpoint for the email editor
get_default_email_post_args()  : array<string|int, mixed>
Returns the default arguments for email post types.
get_post_types()  : array<string|int, mixed>
Returns the email post types.
register_block_patterns()  : void
Register block patterns.
register_block_templates()  : void
Register block templates.
register_email_post_sent_status()  : void
Register the 'sent' post status for emails.
register_email_post_types()  : void
Register all custom post types that should be edited via the email editor The post types are added via mailpoet_email_editor_post_types filter.
register_personalization_tags()  : void
Register all personalization tags registered via the mailpoet_email_editor_register_personalization_tags filter.

Constants

Properties

Methods

__construct()

Constructor.

public __construct(Email_Api_Controller $email_api_controller, Templates $templates, Patterns $patterns, Send_Preview_Email $send_preview_email, Personalization_Tags_Registry $personalization_tags_controller) : mixed
Parameters
$email_api_controller : Email_Api_Controller

Email API controller.

$templates : Templates

Templates.

$patterns : Patterns

Patterns.

$send_preview_email : Send_Preview_Email

Preview email controller.

$personalization_tags_controller : Personalization_Tags_Registry

Personalization tags registry that allows initializing personalization tags.

Return values
mixed

extend_email_theme_styles()

Extends the email theme styles with the email specific styles.

public extend_email_theme_styles(WP_Theme_JSON $theme, WP_Post $post) : WP_Theme_JSON
Parameters
$theme : WP_Theme_JSON

Email theme styles.

$post : WP_Post

Email post object.

Return values
WP_Theme_JSON

load_email_preview_template()

Use a custom page template for the email editor frontend rendering.

public load_email_preview_template(string $template) : string
Parameters
$template : string

post template.

Return values
string

register_email_post_types()

Register all custom post types that should be edited via the email editor The post types are added via mailpoet_email_editor_post_types filter.

private register_email_post_types() : void
Return values
void

register_personalization_tags()

Register all personalization tags registered via the mailpoet_email_editor_register_personalization_tags filter.

private register_personalization_tags() : void
Return values
void