diff --git a/src/EmailSender.php b/src/EmailSender.php index 0318d14e48b6e207b3516ba1411d38ee30eb6bc9..e0a83e666e751cd25186fe0d826d00c0e52d7187 100644 --- a/src/EmailSender.php +++ b/src/EmailSender.php @@ -125,7 +125,7 @@ class EmailSender { public function get_template( EmailInterface $email, $placeholders = [] ): string { $content = $this->replace_placeholders( $email->get_content(), $placeholders ); - $output = $this->renderer->render( 'html/email-header', [] ); + $output = $this->renderer->render( 'html/email-header', [ 'heading' => $email->get_heading(), 'logo' => '' ] ); $output .= $this->renderer->render( 'html/' . $email->get_id(), [ 'content' => $content ] ); $output .= $this->renderer->render( 'html/email-footer', [] ); @@ -149,7 +149,8 @@ class EmailSender { */ private function css_inline( string $content ): string { $styles = $this->renderer->render( 'html/email-styles', [] ); - $body = HTMLDecorator::style_inline( $content, $styles ); + + return HTMLDecorator::style_inline( $content, $styles ); } /** diff --git a/src/tempates/html/email-footer.php b/src/tempates/html/email-footer.php index 4579924cd856f0cb16295e783b68c928a5d5e562..f3c00715ba00bb5cdb75d058f8a8ad5444e2a9ef 100644 --- a/src/tempates/html/email-footer.php +++ b/src/tempates/html/email-footer.php @@ -40,7 +40,7 @@ defined( 'ABSPATH' ) || exit; <table border="0" cellpadding="10" cellspacing="0" width="100%"> <tr> <td colspan="2" valign="middle" id="credit"> - <?php echo wp_kses_post( wpautop( wptexturize( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) ) ) ); ?> + <?php echo wp_kses_post( wpautop( wptexturize( apply_filters( 'wpdesk/wp_mail/template/footer', '' ) ) ) ); ?> </td> </tr> </table> diff --git a/src/tempates/html/email-header.php b/src/tempates/html/email-header.php index 23793c022ab2816de455146e94ed15c9bca4e669..2a6ffecf57c99140551ad815a12ce91bb491f060 100644 --- a/src/tempates/html/email-header.php +++ b/src/tempates/html/email-header.php @@ -16,50 +16,52 @@ */ if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly + exit; // Exit if accessed directly } +$params = isset( $params ) ? $params : []; + ?> <!DOCTYPE html> <html <?php language_attributes(); ?>> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=<?php bloginfo( 'charset' ); ?>" /> - <title><?php echo get_bloginfo( 'name', 'display' ); ?></title> - </head> - <body <?php echo is_rtl() ? 'rightmargin' : 'leftmargin'; ?>="0" marginwidth="0" topmargin="0" marginheight="0" offset="0"> - <div id="wrapper" dir="<?php echo is_rtl() ? 'rtl' : 'ltr'; ?>"> - <table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%"> - <tr> - <td align="center" valign="top"> - <div id="template_header_image"> - <?php - if ( $img = get_option( 'woocommerce_email_header_image' ) ) { - echo '<p style="margin-top:0;"><img src="' . esc_url( $img ) . '" alt="' . get_bloginfo( 'name', 'display' ) . '" /></p>'; - } - ?> - </div> - <table border="0" cellpadding="0" cellspacing="0" width="600" id="template_container"> - <tr> - <td align="center" valign="top"> - <!-- Header --> - <table border="0" cellpadding="0" cellspacing="0" width="100%" id="template_header"> - <tr> - <td id="header_wrapper"> - <h1><?php echo $email_heading; ?></h1> - </td> - </tr> - </table> - <!-- End Header --> - </td> - </tr> - <tr> - <td align="center" valign="top"> - <!-- Body --> - <table border="0" cellpadding="0" cellspacing="0" width="600" id="template_body"> - <tr> - <td valign="top" id="body_content"> - <!-- Content --> - <table border="0" cellpadding="20" cellspacing="0" width="100%"> - <tr> - <td valign="top"> - <div id="body_content_inner"> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=<?php bloginfo( 'charset' ); ?>"/> + <title><?php echo get_bloginfo( 'name', 'display' ); ?></title> +</head> +<body <?php echo is_rtl() ? 'rightmargin' : 'leftmargin'; ?>="0" marginwidth="0" topmargin="0" marginheight="0" offset="0"> +<div id="wrapper" dir="<?php echo is_rtl() ? 'rtl' : 'ltr'; ?>"> + <table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%"> + <tr> + <td align="center" valign="top"> + <div id="template_header_image"> + <?php + if ( $params['logo'] ) { + echo '<p style="margin-top:0;"><img src="' . esc_url( $params['logo'] ) . '" alt="' . get_bloginfo( 'name', 'display' ) . '" /></p>'; + } + ?> + </div> + <table border="0" cellpadding="0" cellspacing="0" width="600" id="template_container"> + <tr> + <td align="center" valign="top"> + <!-- Header --> + <table border="0" cellpadding="0" cellspacing="0" width="100%" id="template_header"> + <tr> + <td id="header_wrapper"> + <h1><?php echo $params['heading']; ?></h1> + </td> + </tr> + </table> + <!-- End Header --> + </td> + </tr> + <tr> + <td align="center" valign="top"> + <!-- Body --> + <table border="0" cellpadding="0" cellspacing="0" width="600" id="template_body"> + <tr> + <td valign="top" id="body_content"> + <!-- Content --> + <table border="0" cellpadding="20" cellspacing="0" width="100%"> + <tr> + <td valign="top"> + <div id="body_content_inner">