Renderer
in package
Class Renderer
Table of Contents
- TEMPLATE_FILE = 'template-canvas.php'
- TEMPLATE_STYLES_FILE = 'template-canvas.css'
- $content_renderer : Content_Renderer
- Content renderer
- $css_inliner : Css_Inliner
- Css inliner
- $templates : Templates
- Templates
- $theme_controller : Theme_Controller
- Theme controller
- __construct() : mixed
- Renderer constructor.
- render() : array<string|int, mixed>
- Renders the email template
- inline_css_styles() : string
- Inlines CSS styles into the HTML
- render_text_version() : string
- Renders the text version of the email template
Constants
TEMPLATE_FILE
public
mixed
TEMPLATE_FILE
= 'template-canvas.php'
TEMPLATE_STYLES_FILE
public
mixed
TEMPLATE_STYLES_FILE
= 'template-canvas.css'
Properties
$content_renderer
Content renderer
private
Content_Renderer
$content_renderer
$css_inliner
Css inliner
private
Css_Inliner
$css_inliner
$templates
Templates
private
Templates
$templates
$theme_controller
Theme controller
private
Theme_Controller
$theme_controller
Methods
__construct()
Renderer constructor.
public
__construct(Content_Renderer $content_renderer, Templates $templates, Css_Inliner $css_inliner, Theme_Controller $theme_controller) : mixed
Parameters
- $content_renderer : Content_Renderer
-
Content renderer.
- $templates : Templates
-
Templates.
- $css_inliner : Css_Inliner
-
CSS Inliner.
- $theme_controller : Theme_Controller
-
Theme controller.
Return values
mixed —render()
Renders the email template
public
render(WP_Post $post, string $subject, string $pre_header, string $language[, string $meta_robots = '' ]) : array<string|int, mixed>
Parameters
- $post : WP_Post
-
Post object.
- $subject : string
-
Email subject.
- $pre_header : string
-
Email preheader.
- $language : string
-
Email language.
- $meta_robots : string = ''
-
Email meta robots.
Return values
array<string|int, mixed> —inline_css_styles()
Inlines CSS styles into the HTML
private
inline_css_styles(string $template) : string
Parameters
- $template : string
-
HTML template.
Return values
string —render_text_version()
Renders the text version of the email template
private
render_text_version(string $template) : string
Parameters
- $template : string
-
HTML template.