Email_Editor
in package
Email editor class.
Tags
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
MAILPOET_EMAIL_META_THEME_TYPE
public
mixed
MAILPOET_EMAIL_META_THEME_TYPE
= 'mailpoet_email_theme'
Properties
$email_api_controller
Property for the email API controller.
private
Email_Api_Controller
$email_api_controller
$patterns
Property for the patterns.
private
Patterns
$patterns
$personalization_tags_registry
Property for Personalization_Tags_Controller that allows initializing personalization tags.
private
Personalization_Tags_Registry
$personalization_tags_registry
$send_preview_email
Property for the send preview email controller.
private
Send_Preview_Email
$send_preview_email
$templates
Property for the templates.
private
Templates
$templates
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_post_api()
Extends the email post types with email specific data.
public
extend_email_post_api() : void
Return values
void —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 —get_current_post()
Get the current post object
public
get_current_post() : array<string|int, mixed>|mixed|WP_Post|null
Return values
array<string|int, mixed>|mixed|WP_Post|null —initialize()
Initialize the email editor.
public
initialize() : void
Return values
void —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_editor_api_routes()
Registers the API route endpoint for the email editor
public
register_email_editor_api_routes() : void
Return values
void —get_default_email_post_args()
Returns the default arguments for email post types.
private
get_default_email_post_args() : array<string|int, mixed>
Return values
array<string|int, mixed> —get_post_types()
Returns the email post types.
private
get_post_types() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —register_block_patterns()
Register block patterns.
private
register_block_patterns() : void
Return values
void —register_block_templates()
Register block templates.
private
register_block_templates() : void
Return values
void —register_email_post_sent_status()
Register the 'sent' post status for emails.
private
register_email_post_sent_status() : void
Return values
void —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