block
3 weeks ago
plain
3 weeks ago
admin-cancelled-order.php
1 year ago
admin-failed-order.php
6 months ago
admin-new-order.php
6 months ago
admin-payment-gateway-enabled.php
2 months ago
customer-cancelled-order.php
6 months ago
customer-completed-order.php
6 months ago
customer-failed-order.php
6 months ago
customer-fulfillment-created.php
6 months ago
customer-fulfillment-deleted.php
6 months ago
customer-fulfillment-updated.php
4 weeks ago
customer-invoice.php
6 months ago
customer-new-account.php
6 months ago
customer-note.php
6 months ago
customer-on-hold-order.php
6 months ago
customer-pos-completed-order.php
6 months ago
customer-pos-refunded-order.php
6 months ago
customer-processing-order.php
6 months ago
customer-refunded-order.php
6 months ago
customer-reset-password.php
6 months ago
customer-review-request.php
3 weeks ago
customer-stock-notification-verified.php
9 months ago
customer-stock-notification-verify.php
9 months ago
customer-stock-notification.php
9 months ago
email-addresses.php
3 months ago
email-customer-details.php
1 year ago
email-downloads.php
6 months ago
email-footer.php
6 months ago
email-fulfillment-details.php
2 months ago
email-fulfillment-items.php
4 weeks ago
email-header.php
2 months ago
email-mobile-messaging.php
2 years ago
email-order-details.php
4 weeks ago
email-order-items.php
4 weeks ago
email-styles.php
4 weeks ago
email-header.php
131 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Email Header |
| 4 | * |
| 5 | * This template can be overridden by copying it to yourtheme/woocommerce/emails/email-header.php. |
| 6 | * |
| 7 | * HOWEVER, on occasion WooCommerce will need to update template files and you |
| 8 | * (the theme developer) will need to copy the new files to your theme to |
| 9 | * maintain compatibility. We try to do this as little as possible, but it does |
| 10 | * happen. When this occurs the version of the template file will be bumped and |
| 11 | * the readme will list any important changes. |
| 12 | * |
| 13 | * @see https://woocommerce.com/document/template-structure/ |
| 14 | * @package WooCommerce\Templates\Emails |
| 15 | * @version 10.7.0 |
| 16 | */ |
| 17 | |
| 18 | use Automattic\WooCommerce\Utilities\FeaturesUtil; |
| 19 | |
| 20 | if ( ! defined( 'ABSPATH' ) ) { |
| 21 | exit; // Exit if accessed directly. |
| 22 | } |
| 23 | |
| 24 | $email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' ); |
| 25 | $store_name = $store_name ?? get_bloginfo( 'name', 'display' ); |
| 26 | |
| 27 | /** |
| 28 | * Filter the URL used for the email header image/logo link. |
| 29 | * |
| 30 | * Return an empty string to disable the link. |
| 31 | * |
| 32 | * @since 10.7.0 |
| 33 | * @param string $url The URL to link to. Defaults to the site home URL. |
| 34 | */ |
| 35 | $header_image_url = apply_filters( 'woocommerce_email_header_image_url', home_url() ); |
| 36 | |
| 37 | ?> |
| 38 | <!DOCTYPE html> |
| 39 | <html <?php language_attributes(); ?>> |
| 40 | <head> |
| 41 | <meta http-equiv="Content-Type" content="text/html; charset=<?php bloginfo( 'charset' ); ?>" /> |
| 42 | <meta content="width=device-width, initial-scale=1.0" name="viewport"> |
| 43 | <title><?php echo esc_html( $store_name ); ?></title> |
| 44 | </head> |
| 45 | <body <?php echo is_rtl() ? 'rightmargin' : 'leftmargin'; ?>="0" marginwidth="0" topmargin="0" marginheight="0" offset="0"> |
| 46 | <table width="100%" id="outer_wrapper" role="presentation"> |
| 47 | <tr> |
| 48 | <td><!-- Deliberately empty to support consistent sizing and layout across multiple email clients. --></td> |
| 49 | <td width="600"> |
| 50 | <div id="wrapper" dir="<?php echo is_rtl() ? 'rtl' : 'ltr'; ?>"> |
| 51 | <table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="inner_wrapper" role="presentation"> |
| 52 | <tr> |
| 53 | <td align="center" valign="top"> |
| 54 | <?php |
| 55 | $img = get_option( 'woocommerce_email_header_image' ); |
| 56 | /** |
| 57 | * This filter is documented in templates/emails/email-styles.php |
| 58 | * |
| 59 | * @since 9.6.0 |
| 60 | */ |
| 61 | if ( apply_filters( 'woocommerce_is_email_preview', false ) ) { |
| 62 | $img_transient = get_transient( 'woocommerce_email_header_image' ); |
| 63 | $img = false !== $img_transient ? $img_transient : $img; |
| 64 | } |
| 65 | |
| 66 | if ( $email_improvements_enabled ) : |
| 67 | ?> |
| 68 | <table border="0" cellpadding="0" cellspacing="0" width="100%" role="presentation"> |
| 69 | <tr> |
| 70 | <td id="template_header_image"> |
| 71 | <?php |
| 72 | if ( $img ) { |
| 73 | $image_html = '<img src="' . esc_url( $img ) . '" alt="' . esc_attr( $store_name ) . '" />'; |
| 74 | if ( $header_image_url ) { |
| 75 | // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- $image_html is built from esc_url() and esc_attr(). |
| 76 | echo '<p style="margin-top:0;"><a href="' . esc_url( $header_image_url ) . '" style="display: inline-block; text-decoration: none;" target="_blank">' . $image_html . '</a></p>'; |
| 77 | } else { |
| 78 | // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 79 | echo '<p style="margin-top:0;">' . $image_html . '</p>'; |
| 80 | } |
| 81 | } elseif ( $header_image_url ) { |
| 82 | echo '<p class="email-logo-text"><a href="' . esc_url( $header_image_url ) . '" style="color: inherit; text-decoration: none;" target="_blank">' . esc_html( $store_name ) . '</a></p>'; |
| 83 | } else { |
| 84 | echo '<p class="email-logo-text">' . esc_html( $store_name ) . '</p>'; |
| 85 | } |
| 86 | ?> |
| 87 | </td> |
| 88 | </tr> |
| 89 | </table> |
| 90 | <?php else : ?> |
| 91 | <div id="template_header_image"> |
| 92 | <?php |
| 93 | if ( $img ) { |
| 94 | $image_html = '<img src="' . esc_url( $img ) . '" alt="' . esc_attr( $store_name ) . '" />'; |
| 95 | if ( $header_image_url ) { |
| 96 | // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- $image_html is built from esc_url() and esc_attr(). |
| 97 | echo '<p style="margin-top:0;"><a href="' . esc_url( $header_image_url ) . '" style="display: inline-block; text-decoration: none;" target="_blank">' . $image_html . '</a></p>'; |
| 98 | } else { |
| 99 | // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 100 | echo '<p style="margin-top:0;">' . $image_html . '</p>'; |
| 101 | } |
| 102 | } |
| 103 | ?> |
| 104 | </div> |
| 105 | <?php endif; ?> |
| 106 | <table border="0" cellpadding="0" cellspacing="0" width="100%" id="template_container" role="presentation"> |
| 107 | <tr> |
| 108 | <td align="center" valign="top"> |
| 109 | <!-- Header --> |
| 110 | <table border="0" cellpadding="0" cellspacing="0" width="100%" id="template_header" role="presentation"> |
| 111 | <tr> |
| 112 | <td id="header_wrapper"> |
| 113 | <h1><?php echo esc_html( $email_heading ); ?></h1> |
| 114 | </td> |
| 115 | </tr> |
| 116 | </table> |
| 117 | <!-- End Header --> |
| 118 | </td> |
| 119 | </tr> |
| 120 | <tr> |
| 121 | <td align="center" valign="top"> |
| 122 | <!-- Body --> |
| 123 | <table border="0" cellpadding="0" cellspacing="0" width="100%" id="template_body" role="presentation"> |
| 124 | <tr> |
| 125 | <td valign="top" id="body_content"> |
| 126 | <!-- Content --> |
| 127 | <table border="0" cellpadding="20" cellspacing="0" width="100%" role="presentation"> |
| 128 | <tr> |
| 129 | <td valign="top" id="body_content_inner_cell"> |
| 130 | <div id="body_content_inner"> |
| 131 |