ContentRenderer
1 month ago
class-html2text-exception.php
10 months ago
class-html2text.php
10 months ago
class-renderer.php
1 month ago
interface-css-inliner.php
1 year ago
template-canvas.css
1 month ago
template-canvas.php
1 month ago
template-canvas.php
60 lines
| 1 | <?php |
| 2 | /** |
| 3 | * This file is part of the WooCommerce Email Editor package. |
| 4 | * |
| 5 | * @package Automattic\WooCommerce\EmailEditor |
| 6 | */ |
| 7 | |
| 8 | declare(strict_types = 1); |
| 9 | |
| 10 | // phpcs:disable Generic.Files.InlineHTML.Found |
| 11 | // phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped |
| 12 | /** |
| 13 | * Template file to render the current 'wp_template', specifcally for emails. |
| 14 | * |
| 15 | * Variables passed to this template: |
| 16 | * |
| 17 | * @var string $subject The email subject |
| 18 | * @var string $pre_header The email pre-header text |
| 19 | * @var string $template_html The email template HTML content |
| 20 | * @var string $meta_robots Meta robots tag content |
| 21 | * @var array{contentSize: string} $layout Layout configuration |
| 22 | * @var Automattic\WooCommerce\EmailEditor\Engine\Renderer\ContentRenderer\Rendering_Context $rendering_context Rendering context |
| 23 | */ |
| 24 | $language_attributes = get_language_attributes(); |
| 25 | $language_attributes = trim( (string) preg_replace( '/\s?dir=(["\']).*?\1/i', '', $language_attributes ) ); |
| 26 | $language_attributes = trim( $language_attributes . ' dir="' . esc_attr( $rendering_context->get_text_direction() ) . '"' ); |
| 27 | ?><!DOCTYPE html> |
| 28 | <html <?php echo $language_attributes; ?>> |
| 29 | <head> |
| 30 | <title><?php echo esc_html( $subject ); ?></title> |
| 31 | <meta charset="<?php bloginfo( 'charset' ); ?>" /> |
| 32 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
| 33 | <meta name="viewport" content="width=device-width, initial-scale=1" /> |
| 34 | <meta http-equiv="X-UA-Compatible" content="IE=edge" /> |
| 35 | <meta name="format-detection" content="telephone=no" /> |
| 36 | <?php echo $meta_robots; ?> |
| 37 | <!-- Forced Styles --> |
| 38 | </head> |
| 39 | <body dir="<?php echo esc_attr( $rendering_context->get_text_direction() ); ?>"> |
| 40 | <!--[if mso | IE]><table align="center" role="presentation" border="0" cellpadding="0" cellspacing="0" width="<?php echo esc_attr( $layout['contentSize'] ); ?>" style="width:<?php echo esc_attr( $layout['contentSize'] ); ?>"><tr><td><![endif]--> |
| 41 | <div class="email_layout_wrapper" style="max-width: <?php echo esc_attr( $layout['contentSize'] ); ?>"> |
| 42 | <table width="100%" border="0" cellpadding="0" cellspacing="0" role="presentation"> |
| 43 | <tbody> |
| 44 | <tr> |
| 45 | <td class="email_preheader" height="1"> |
| 46 | <?php echo esc_html( wp_strip_all_tags( $pre_header ) ); ?> |
| 47 | </td> |
| 48 | </tr> |
| 49 | <tr> |
| 50 | <td class="email_content_wrapper"> |
| 51 | <?php echo $template_html; ?> |
| 52 | </td> |
| 53 | </tr> |
| 54 | </tbody> |
| 55 | </table> |
| 56 | </div> |
| 57 | <!--[if mso | IE]></td></tr></table><![endif]--> |
| 58 | </body> |
| 59 | </html> |
| 60 |