Файловый менеджер - Редактировать - /home/tuudkjt/globeasy/wp-includes/ID3/emails.tar
Назад
class-wc-email-customer-pos-completed-order.php 0000777 00000036326 15252364676 0015640 0 ustar 00 <?php /** * Class WC_Email_Customer_POS_Completed_Order file. * * @package WooCommerce\Emails */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } use Automattic\WooCommerce\Internal\Email\OrderPriceFormatter; use Automattic\WooCommerce\Internal\Orders\PointOfSaleOrderUtil; use Automattic\WooCommerce\Internal\Settings\PointOfSaleDefaultSettings; use Automattic\WooCommerce\Utilities\FeaturesUtil; if ( ! class_exists( 'WC_Email_Customer_POS_Completed_Order', false ) ) : /** * Customer Completed Order Email. * * Order complete emails are sent to the customer when the order is marked complete and usual indicates that the order has been shipped. * * @class WC_Email_Customer_POS_Completed_Order * @version 2.0.0 * @package WooCommerce\Classes\Emails * @extends WC_Email */ class WC_Email_Customer_POS_Completed_Order extends WC_Email { /** * Constructor. */ public function __construct() { $this->id = 'customer_pos_completed_order'; $this->customer_email = true; $this->title = __( 'POS completed order', 'woocommerce' ); $this->email_group = 'payments'; $this->template_html = 'emails/customer-pos-completed-order.php'; $this->template_plain = 'emails/plain/customer-pos-completed-order.php'; $this->placeholders = array( '{order_date}' => '', '{order_number}' => '', ); $this->enable_order_email_actions_for_pos_orders(); // Call parent constructor. parent::__construct(); // Must be after parent's constructor which sets `email_improvements_enabled` property. $this->description = $this->email_improvements_enabled ? __( 'Let customers know once their POS order is complete.', 'woocommerce' ) : __( 'Order complete emails are sent to customers when their POS orders are marked completed.', 'woocommerce' ); $this->manual = true; if ( $this->block_email_editor_enabled ) { $this->title = __( 'POS order complete', 'woocommerce' ); $this->description = __( 'Notifies customers when their in-person (POS) order has been completed.', 'woocommerce' ); } } /** * Trigger the sending of this email. * * @param int $order_id The order ID. * @param string $template_id The email template ID. */ public function trigger( $order_id, $template_id ) { if ( $this->id !== $template_id ) { return; } $this->setup_locale(); if ( $order_id ) { $order = wc_get_order( $order_id ); } if ( is_a( $order, 'WC_Order' ) ) { $this->object = $order; $this->recipient = $this->object->get_billing_email(); $this->placeholders['{order_date}'] = wc_format_datetime( $this->object->get_date_created() ); $this->placeholders['{order_number}'] = $this->object->get_order_number(); } if ( $this->get_recipient() ) { $this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() ); } $this->restore_locale(); } /** * Get email subject. * * @since 3.1.0 * @return string */ public function get_default_subject() { $store_name = $this->get_pos_store_name(); /* translators: %1$s: Order number, %2$s: Store name */ return sprintf( __( 'Your in-store purchase #%1$s at %2$s', 'woocommerce' ), '{order_number}', esc_html( $store_name ) ); } /** * Get email heading. * * @since 3.1.0 * @return string */ public function get_default_heading() { return __( 'Thank you for your in-store purchase', 'woocommerce' ); } /** * Get content html. * * @return string */ public function get_content_html() { $this->add_pos_customizations(); add_action( 'woocommerce_pos_email_header', array( $this, 'email_header' ) ); add_action( 'woocommerce_pos_email_footer', array( $this, 'email_footer' ) ); $content = wc_get_template_html( $this->template_html, array( 'order' => $this->object, 'email_heading' => $this->get_heading(), 'additional_content' => $this->get_additional_content(), 'pos_store_name' => $this->get_pos_store_name(), 'pos_store_email' => $this->get_pos_store_email(), 'pos_store_phone_number' => $this->get_pos_store_phone_number(), 'pos_store_address' => $this->get_pos_store_address(), 'pos_refund_returns_policy' => $this->get_pos_refund_returns_policy(), 'sent_to_admin' => false, 'plain_text' => false, 'email' => $this, ) ); $this->remove_pos_customizations(); remove_action( 'woocommerce_pos_email_header', array( $this, 'email_header' ) ); remove_action( 'woocommerce_pos_email_footer', array( $this, 'email_footer' ) ); return $content; } /** * Get content plain. * * @return string */ public function get_content_plain() { $this->add_pos_customizations(); $content = wc_get_template_html( $this->template_plain, array( 'order' => $this->object, 'email_heading' => $this->get_heading(), 'additional_content' => $this->get_additional_content(), 'pos_store_name' => $this->get_pos_store_name(), 'pos_store_email' => $this->get_pos_store_email(), 'pos_store_phone_number' => $this->get_pos_store_phone_number(), 'pos_store_address' => $this->get_pos_store_address(), 'pos_refund_returns_policy' => $this->get_pos_refund_returns_policy(), 'sent_to_admin' => false, 'plain_text' => true, 'email' => $this, ) ); $this->remove_pos_customizations(); return $content; } /** * Get block editor email template content. * * @return string */ public function get_block_editor_email_template_content() { $this->add_pos_customizations(); return wc_get_template_html( $this->template_block_content, array( 'order' => $this->object, 'sent_to_admin' => false, 'plain_text' => false, 'email' => $this, ) ); } /** * Enable order email actions for POS orders. */ private function enable_order_email_actions_for_pos_orders() { $this->enable_email_template_for_pos_orders(); // Enable send email when requested. add_action( 'woocommerce_rest_order_actions_email_send', array( $this, 'trigger' ), 10, 2 ); } /** * Override settings form fields to remove the enabled/disabled field as the email is manually sent. */ public function init_form_fields() { /* translators: %s: list of placeholders */ $placeholder_text = sprintf( __( 'Available placeholders: %s', 'woocommerce' ), '<code>' . esc_html( implode( '</code>, <code>', array_keys( $this->placeholders ) ) ) . '</code>' ); $this->form_fields = array( 'subject' => array( 'title' => __( 'Subject', 'woocommerce' ), 'type' => 'text', 'desc_tip' => true, 'description' => $placeholder_text, 'placeholder' => $this->get_default_subject(), 'default' => '', ), 'heading' => array( 'title' => __( 'Email heading', 'woocommerce' ), 'type' => 'text', 'desc_tip' => true, 'description' => $placeholder_text, 'placeholder' => $this->get_default_heading(), 'default' => '', ), 'additional_content' => array( 'title' => __( 'Additional content', 'woocommerce' ), 'description' => __( 'Text to appear below the main email content.', 'woocommerce' ) . ' ' . $placeholder_text, 'css' => 'width:400px; height: 75px;', 'placeholder' => __( 'N/A', 'woocommerce' ), 'type' => 'textarea', 'default' => $this->get_default_additional_content(), 'desc_tip' => true, ), 'email_type' => array( 'title' => __( 'Email type', 'woocommerce' ), 'type' => 'select', 'description' => __( 'Choose which format of email to send.', 'woocommerce' ), 'default' => 'html', 'class' => 'email_type wc-enhanced-select', 'options' => $this->get_email_type_options(), 'desc_tip' => true, ), ); if ( FeaturesUtil::feature_is_enabled( 'email_improvements' ) ) { $this->form_fields['cc'] = $this->get_cc_field(); $this->form_fields['bcc'] = $this->get_bcc_field(); } } /** * Add actions and filters before generating email content. */ private function add_pos_customizations() { // Add action to display unit price in the beginning of the order item meta. add_action( 'woocommerce_order_item_meta_start', array( $this, 'add_unit_price' ), 10, 4 ); // Add filter to include additional details in the order item totals table. add_filter( 'woocommerce_get_order_item_totals', array( $this, 'order_item_totals' ), 10, 3 ); // Add filter for custom footer text with highest priority to run before the default footer text filtering in `WC_Emails`. add_filter( 'woocommerce_email_footer_text', array( $this, 'replace_footer_placeholders' ), 1, 2 ); } /** * Remove actions and filters after generating email content. */ private function remove_pos_customizations() { // Remove actions and filters after generating content to avoid affecting other emails. remove_action( 'woocommerce_order_item_meta_start', array( $this, 'add_unit_price' ), 10 ); remove_filter( 'woocommerce_get_order_item_totals', array( $this, 'order_item_totals' ), 10 ); remove_filter( 'woocommerce_email_footer_text', array( $this, 'replace_footer_placeholders' ), 1 ); } /** * Get the email header. * * @param mixed $email_heading Heading for the email. * * @internal For exclusive usage within this class, backwards compatibility not guaranteed. */ public function email_header( $email_heading ) { wc_get_template( 'emails/email-header.php', array( 'email_heading' => $email_heading, 'store_name' => $this->get_pos_store_name(), ) ); } /** * Get the email footer. * * @param mixed $email Email object. * * @internal For exclusive usage within this class, backwards compatibility not guaranteed. */ public function email_footer( $email ) { wc_get_template( 'emails/email-footer.php', array( 'email' => $email, ) ); } /** * Add unit price to order item meta start position. * * @param int $item_id Order item ID. * @param array $item Order item data. * @param WC_Order $order Order object. */ public function add_unit_price( $item_id, $item, $order ) { $unit_price = OrderPriceFormatter::get_formatted_item_subtotal( $order, $item, get_option( 'woocommerce_tax_display_cart' ) ); echo wp_kses_post( '<br /><small>' . $unit_price . '</small>' ); } /** * Add additional details to the order item totals table. * * @param array $total_rows Array of total rows. * @param WC_Order $order Order object. * @param string $tax_display Tax display. * @return array Modified array of total rows. */ public function order_item_totals( $total_rows, $order, $tax_display ) { $cash_payment_change_due_amount = $order->get_meta( '_cash_change_amount', true ); if ( '' !== $cash_payment_change_due_amount ) { $formatted_cash_payment_change_due_amount = wc_price( $cash_payment_change_due_amount, array( 'currency' => $order->get_currency() ) ); $total_rows['cash_payment_change_due_amount'] = array( 'type' => 'cash_payment_change_due_amount', 'label' => __( 'Change due:', 'woocommerce' ), 'value' => $formatted_cash_payment_change_due_amount, ); } $auth_code = $order->get_meta( '_charge_id', true ); if ( ! empty( $auth_code ) ) { $total_rows['payment_auth_code'] = array( 'type' => 'payment_auth_code', 'label' => __( 'Auth code:', 'woocommerce' ), 'value' => $auth_code, ); } if ( $order->get_date_paid() !== null ) { $total_rows['date_paid'] = array( 'type' => 'date_paid', 'label' => __( 'Time of payment:', 'woocommerce' ), 'value' => wc_format_datetime( $order->get_date_paid(), get_option( 'date_format' ) . ' ' . get_option( 'time_format' ) ), ); } return $total_rows; } /** * Enable email template for REST API order valid templates for POS orders. */ private function enable_email_template_for_pos_orders() { add_filter( 'woocommerce_rest_order_actions_email_valid_template_classes', array( $this, 'add_to_valid_template_classes' ), 10, 2 ); } /** * Add this email template to the list of valid templates for POS orders. * * @param array $valid_template_classes Array of valid template class names. * @param WC_Order $order The order. * @return array Modified array of valid template class names. */ public function add_to_valid_template_classes( $valid_template_classes, $order ) { if ( ! PointOfSaleOrderUtil::is_pos_order( $order ) ) { return $valid_template_classes; } $valid_template_classes[] = get_class( $this ); return $valid_template_classes; } /** * Get the store name from POS settings. * * @return string */ private function get_pos_store_name() { $store_name = get_option( 'woocommerce_pos_store_name' ); return $this->format_string( empty( $store_name ) ? PointOfSaleDefaultSettings::get_default_store_name() : $store_name ); } /** * Get the store email from POS settings. * * @return string */ private function get_pos_store_email() { return $this->format_string( get_option( 'woocommerce_pos_store_email', PointOfSaleDefaultSettings::get_default_store_email() ) ); } /** * Get the store phone number from POS settings. * * @return string */ private function get_pos_store_phone_number() { return $this->format_string( get_option( 'woocommerce_pos_store_phone' ) ); } /** * Get the store address from POS settings. * * @return string */ private function get_pos_store_address() { return $this->format_string( get_option( 'woocommerce_pos_store_address', PointOfSaleDefaultSettings::get_default_store_address() ) ); } /** * Get the refund and returns policy from POS settings. * * @return string */ private function get_pos_refund_returns_policy() { return $this->format_string( get_option( 'woocommerce_pos_refund_returns_policy' ) ); } /** * Replace footer text placeholders with POS-specific values. * * @param string $footer_text The footer text to be filtered. * @param mixed $email Email object. * @return string Modified footer text. * * @internal For exclusive usage within this class, backwards compatibility not guaranteed. */ public function replace_footer_placeholders( $footer_text, $email ) { // Only replace placeholders if we're in the context of a POS email. if ( $email->id !== $this->id ) { return $footer_text; } return str_replace( array( '{site_title}', '{store_address}', '{store_email}', ), array( $this->get_pos_store_name(), $this->get_pos_store_address(), $this->get_pos_store_email(), ), $footer_text ); } } endif; return new WC_Email_Customer_POS_Completed_Order(); class-wc-email-customer-completed-order.php 0000777 00000011416 15252364676 0015032 0 ustar 00 <?php /** * Class WC_Email_Customer_Completed_Order file. * * @package WooCommerce\Emails */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } if ( ! class_exists( 'WC_Email_Customer_Completed_Order', false ) ) : /** * Customer Completed Order Email. * * Order complete emails are sent to the customer when the order is marked complete and usual indicates that the order has been shipped. * * @class WC_Email_Customer_Completed_Order * @version 2.0.0 * @package WooCommerce\Classes\Emails * @extends WC_Email */ class WC_Email_Customer_Completed_Order extends WC_Email { /** * Constructor. */ public function __construct() { $this->id = 'customer_completed_order'; $this->customer_email = true; $this->title = __( 'Completed order', 'woocommerce' ); $this->email_group = 'order-updates'; $this->template_html = 'emails/customer-completed-order.php'; $this->template_plain = 'emails/plain/customer-completed-order.php'; $this->placeholders = array( '{order_date}' => '', '{order_number}' => '', ); // Triggers for this email. add_action( 'woocommerce_order_status_completed_notification', array( $this, 'trigger' ), 10, 2 ); // Call parent constructor. parent::__construct(); // Must be after parent's constructor which sets `email_improvements_enabled` property. $this->description = $this->email_improvements_enabled ? __( 'Send an email to customers notifying them that their order is complete and has been shipped', 'woocommerce' ) : __( 'Order complete emails are sent to customers when their orders are marked completed and usually indicate that their orders have been shipped.', 'woocommerce' ); if ( $this->block_email_editor_enabled ) { $this->title = __( 'Order fulfilled', 'woocommerce' ); $this->description = __( 'Notifies customers when their order has been shipped.', 'woocommerce' ); } } /** * Trigger the sending of this email. * * @param int $order_id The order ID. * @param WC_Order|false $order Order object. */ public function trigger( $order_id, $order = false ) { $this->setup_locale(); if ( $order_id && ! is_a( $order, 'WC_Order' ) ) { $order = wc_get_order( $order_id ); } if ( is_a( $order, 'WC_Order' ) ) { $this->object = $order; $this->recipient = $this->object->get_billing_email(); $this->placeholders['{order_date}'] = wc_format_datetime( $this->object->get_date_created() ); $this->placeholders['{order_number}'] = $this->object->get_order_number(); } if ( $this->is_enabled() && $this->get_recipient() ) { $this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() ); } $this->restore_locale(); } /** * Get email subject. * * @since 3.1.0 * @return string */ public function get_default_subject() { return $this->email_improvements_enabled ? __( 'Your order from {site_title} is on its way!', 'woocommerce' ) : __( 'Your {site_title} order is now complete', 'woocommerce' ); } /** * Get email heading. * * @since 3.1.0 * @return string */ public function get_default_heading() { return $this->email_improvements_enabled ? __( 'Good things are heading your way!', 'woocommerce' ) : __( 'Thanks for shopping with us', 'woocommerce' ); } /** * Get content html. * * @return string */ public function get_content_html() { return wc_get_template_html( $this->template_html, array( 'order' => $this->object, 'email_heading' => $this->get_heading(), 'additional_content' => $this->get_additional_content(), 'sent_to_admin' => false, 'plain_text' => false, 'email' => $this, ) ); } /** * Get content plain. * * @return string */ public function get_content_plain() { return wc_get_template_html( $this->template_plain, array( 'order' => $this->object, 'email_heading' => $this->get_heading(), 'additional_content' => $this->get_additional_content(), 'sent_to_admin' => false, 'plain_text' => true, 'email' => $this, ) ); } /** * Default content to show below main email content. * * @since 3.7.0 * @return string */ public function get_default_additional_content() { return $this->email_improvements_enabled ? __( 'Thanks again! If you need any help with your order, please contact us at {store_email}.', 'woocommerce' ) : __( 'Thanks for shopping with us.', 'woocommerce' ); } } endif; return new WC_Email_Customer_Completed_Order(); class-wc-email.php 0000777 00000151467 15252364676 0010123 0 ustar 00 <?php /** * Class WC_Email file. * * @package WooCommerce\Emails */ use Automattic\WooCommerce\Internal\EmailEditor\BlockEmailRenderer; use Automattic\WooCommerce\Internal\EmailEditor\TransactionalEmailPersonalizer; use Automattic\WooCommerce\Utilities\FeaturesUtil; use Automattic\WooCommerce\Vendor\Pelago\Emogrifier\CssInliner; use Automattic\WooCommerce\Vendor\Pelago\Emogrifier\HtmlProcessor\CssToAttributeConverter; use Automattic\WooCommerce\Vendor\Pelago\Emogrifier\HtmlProcessor\HtmlPruner; if ( ! defined( 'ABSPATH' ) ) { exit; } if ( class_exists( 'WC_Email', false ) ) { return; } /** * Email Class * * WooCommerce Email Class which is extended by specific email template classes to add emails to WooCommerce * * @class WC_Email * @version 2.5.0 * @package WooCommerce\Classes\Emails * @extends WC_Settings_API */ class WC_Email extends WC_Settings_API { /** * Email method ID. * * @var String */ public $id; /** * Email method title. * * @var string */ public $title; /** * 'yes' if the method is enabled. * * @var string yes, no */ public $enabled; /** * Description for the email. * * @var string */ public $description; /** * Default heading. * * Supported for backwards compatibility but we recommend overloading the * get_default_x methods instead so localization can be done when needed. * * @var string */ public $heading = ''; /** * Default subject. * * Supported for backwards compatibility but we recommend overloading the * get_default_x methods instead so localization can be done when needed. * * @var string */ public $subject = ''; /** * Plain text template path. * * @var string */ public $template_plain; /** * HTML template path. * * @var string */ public $template_html; /** * Initial email block template path. * * @var string */ public $template_block; /** * Template path. * * @var string */ public $template_base; /** * Recipients for the email. * * @var string */ public $recipient; /** * Cc recipients for the email. * * @var string */ public $cc; /** * Bcc recipients for the email. * * @var string */ public $bcc; /** * Object this email is for, for example a customer, product, or email. * * @var object|bool */ public $object; /** * Mime boundary (for multipart emails). * * @var string */ public $mime_boundary; /** * Mime boundary header (for multipart emails). * * @var string */ public $mime_boundary_header; /** * True when email is being sent. * * @var bool */ public $sending; /** * True when the email notification is sent manually only. * * @var bool */ protected $manual = false; /** * True when the email notification is sent to customers. * * @var bool */ protected $customer_email = false; /** * Email group slug. * * @var string */ public $email_group = ''; /** * List of preg* regular expression patterns to search for, * used in conjunction with $plain_replace. * https://raw.github.com/ushahidi/wp-silcc/master/class.html2text.inc * * @var array $plain_search * @see $plain_replace */ public $plain_search = array( "/\r/", // Non-legal carriage return. '/&(nbsp|#0*160);/i', // Non-breaking space. '/&(quot|rdquo|ldquo|#0*8220|#0*8221|#0*147|#0*148);/i', // Double quotes. '/&(apos|rsquo|lsquo|#0*8216|#0*8217);/i', // Single quotes. '/>/i', // Greater-than. '/</i', // Less-than. '/�*38;/i', // Ampersand. '/&/i', // Ampersand. '/&(copy|#0*169);/i', // Copyright. '/&(trade|#0*8482|#0*153);/i', // Trademark. '/&(reg|#0*174);/i', // Registered. '/&(mdash|#0*151|#0*8212);/i', // mdash. '/&(ndash|minus|#0*8211|#0*8722);/i', // ndash. '/&(bull|#0*149|#0*8226);/i', // Bullet. '/&(pound|#0*163);/i', // Pound sign. '/&(euro|#0*8364);/i', // Euro sign. '/&(dollar|#0*36);/i', // Dollar sign. '/&[^&\s;]+;/i', // Unknown/unhandled entities. '/[ ]{2,}/', // Runs of spaces, post-handling. ); /** * List of pattern replacements corresponding to patterns searched. * * @var array $plain_replace * @see $plain_search */ public $plain_replace = array( '', // Non-legal carriage return. ' ', // Non-breaking space. '"', // Double quotes. "'", // Single quotes. '>', // Greater-than. '<', // Less-than. '&', // Ampersand. '&', // Ampersand. '(c)', // Copyright. '(tm)', // Trademark. '(R)', // Registered. '--', // mdash. '-', // ndash. '*', // Bullet. '£', // Pound sign. 'EUR', // Euro sign. € ?. '$', // Dollar sign. '', // Unknown/unhandled entities. ' ', // Runs of spaces, post-handling. ); /** * Strings to find/replace in subjects/headings. * * @var array */ public $placeholders = array(); /** * Strings to find in subjects/headings. * * @deprecated 3.2.0 in favour of placeholders * @var array */ public $find = array(); /** * Strings to replace in subjects/headings. * * @deprecated 3.2.0 in favour of placeholders * @var array */ public $replace = array(); /** * E-mail type: plain, html or multipart. * * @var string */ public $email_type; /** * Whether email improvements feature is enabled. * * @var bool */ public $email_improvements_enabled; /** * Whether email block editor feature is enabled. * * @var bool */ public $block_email_editor_enabled; /** * Personalizer instance for converting Personalization tags. * * @var TransactionalEmailPersonalizer */ public $personalizer; /** * Block content template path. * * @var string */ public $template_block_content = 'emails/block/general-block-email.php'; /** * Constructor. */ public function __construct() { $this->email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' ); $this->block_email_editor_enabled = FeaturesUtil::feature_is_enabled( 'block_email_editor' ); // Find/replace. $this->placeholders = array_merge( array( '{site_title}' => $this->get_blogname(), '{site_address}' => wp_parse_url( home_url(), PHP_URL_HOST ), '{site_url}' => wp_parse_url( home_url(), PHP_URL_HOST ), '{store_email}' => $this->get_from_address(), ), $this->placeholders ); // Init settings. $this->init_form_fields(); $this->init_settings(); // Default template base if not declared in child constructor. if ( is_null( $this->template_base ) ) { $this->template_base = WC()->plugin_path() . '/templates/'; } $this->email_type = $this->get_option( 'email_type' ); $this->enabled = $this->get_option( 'enabled' ); if ( FeaturesUtil::feature_is_enabled( 'email_improvements' ) ) { $this->cc = $this->get_option( 'cc', '' ); $this->bcc = $this->get_option( 'bcc', '' ); } if ( $this->block_email_editor_enabled ) { $this->personalizer = wc_get_container()->get( TransactionalEmailPersonalizer::class ); } add_action( 'phpmailer_init', array( $this, 'handle_multipart' ) ); add_action( 'woocommerce_update_options_email_' . $this->id, array( $this, 'process_admin_options' ) ); // Use priority 1 to ensure our skip classes are added before lazy loading plugins process the images. add_filter( 'wp_get_attachment_image_attributes', array( $this, 'prevent_lazy_loading_on_attachment' ), 1, 1 ); } /** * Handle multipart mail. * * @param PHPMailer $mailer PHPMailer object. * @return PHPMailer */ public function handle_multipart( $mailer ) { if ( ! $this->sending ) { return $mailer; } if ( 'multipart' === $this->get_email_type() ) { $mailer->AltBody = wordwrap( // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase preg_replace( $this->plain_search, $this->plain_replace, wp_strip_all_tags( $this->get_content_plain() ) ) ); } else { $mailer->AltBody = ''; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase } $this->sending = false; return $mailer; } /** * Format email string. * * @param mixed $string Text to replace placeholders in. * @return string */ public function format_string( $string ) { $find = array_keys( $this->placeholders ); $replace = array_values( $this->placeholders ); // If using legacy find replace, add those to our find/replace arrays first. @todo deprecate in 4.0.0. $find = array_merge( (array) $this->find, $find ); $replace = array_merge( (array) $this->replace, $replace ); // Take care of blogname which is no longer defined as a valid placeholder. $find[] = '{blogname}'; $replace[] = $this->get_blogname(); // If using the older style filters for find and replace, ensure the array is associative and then pass through filters. @todo deprecate in 4.0.0. if ( has_filter( 'woocommerce_email_format_string_replace' ) || has_filter( 'woocommerce_email_format_string_find' ) ) { $legacy_find = $this->find; $legacy_replace = $this->replace; foreach ( $this->placeholders as $find => $replace ) { $legacy_key = sanitize_title( str_replace( '_', '-', trim( $find, '{}' ) ) ); $legacy_find[ $legacy_key ] = $find; $legacy_replace[ $legacy_key ] = $replace; } $string = str_replace( apply_filters( 'woocommerce_email_format_string_find', $legacy_find, $this ), apply_filters( 'woocommerce_email_format_string_replace', $legacy_replace, $this ), $string ); } /** * Filter for main find/replace. * * @since 3.2.0 */ return apply_filters( 'woocommerce_email_format_string', str_replace( $find, $replace, $string ), $this ); } /** * Set the locale to the store locale for customer emails to make sure emails are in the store language. */ public function setup_locale() { /** * Filter the ability to switch email locale. * * @since 6.8.0 * * @param bool $default_value The default returned value. * @param WC_Email $email The WC_Email object. */ $switch_email_locale = apply_filters( 'woocommerce_allow_switching_email_locale', true, $this ); if ( $switch_email_locale && $this->is_customer_email() && apply_filters( 'woocommerce_email_setup_locale', true ) ) { wc_switch_to_site_locale(); } } /** * Restore the locale to the default locale. Use after finished with setup_locale. */ public function restore_locale() { /** * Filter the ability to restore email locale. * * @since 6.8.0 * * @param bool $default_value The default returned value. * @param WC_Email $email The WC_Email object. */ $restore_email_locale = apply_filters( 'woocommerce_allow_restoring_email_locale', true, $this ); if ( $restore_email_locale && $this->is_customer_email() && apply_filters( 'woocommerce_email_restore_locale', true ) ) { wc_restore_locale(); } } /** * Get available email groups with their titles. * * @since 10.3.0 * @return array Associative array of email group slugs => titles. */ public function get_email_groups() { $email_groups = array( 'accounts' => __( 'Accounts', 'woocommerce' ), 'orders' => __( 'Orders', 'woocommerce' ), 'order-processing' => __( 'Order updates', 'woocommerce' ), // @deprecated Please use 'order-updates' instead. Will be removed in 10.5.0. 'order-updates' => __( 'Order updates', 'woocommerce' ), 'order-exceptions' => __( 'Order changes', 'woocommerce' ), // @deprecated Please use 'order-changes' instead. Will be removed in 10.5.0. 'order-changes' => __( 'Order changes', 'woocommerce' ), 'payments' => __( 'Payments', 'woocommerce' ), ); /** * Filter the available email groups. * * @since 10.3.0 * @param array $email_groups Associative array of email group slugs => titles. */ return apply_filters( 'woocommerce_email_groups', $email_groups ); } /** * Get the title for the current email group. * * @since 10.3.0 * @return string The email group title. Falls back to the email group slug if not found. */ public function get_email_group_title() { $email_groups = $this->get_email_groups(); $title = isset( $email_groups[ $this->email_group ] ) ? $email_groups[ $this->email_group ] : $this->email_group; /** * Filter the email group title. * * @since 10.3.0 * @param string $title The email group title. * @param string $email_group The email group slug. * @param array $email_groups Associative array of email group slugs => titles. */ return (string) apply_filters( 'woocommerce_email_group_title', $title, $this->email_group, $email_groups ); } /** * Get email subject. * * @since 3.1.0 * @return string */ public function get_default_subject() { return $this->subject; } /** * Get email heading. * * @since 3.1.0 * @return string */ public function get_default_heading() { return $this->heading; } /** * Default content to show below main email content. * * @since 3.7.0 * @return string */ public function get_default_additional_content() { return ''; } /** * Return content from the additional_content field. * * Displayed above the footer. * * @since 3.7.0 * @return string */ public function get_additional_content() { /** * Provides an opportunity to inspect and modify additional content for the email. * * @since 3.7.0 * * @param string $additional_content Additional content to be added to the email. * @param object|bool $object The object (ie, product or order) this email relates to, if any. * @param WC_Email $email WC_Email instance managing the email. */ return apply_filters( 'woocommerce_email_additional_content_' . $this->id, $this->format_string( $this->get_option_or_transient( 'additional_content' ) ), $this->object, $this ); } /** * Get email subject. * * @return string */ public function get_subject() { /** * Provides an opportunity to inspect and modify subject for the email. * * @since 2.0.0 * * @param string $subject Subject of the email. * @param object|bool $object The object (ie, product or order) this email relates to, if any. * @param WC_Email $email WC_Email instance managing the email. */ $subject = apply_filters( 'woocommerce_email_subject_' . $this->id, $this->format_string( $this->get_option_or_transient( 'subject', $this->get_default_subject() ) ), $this->object, $this ); if ( $this->block_email_editor_enabled ) { // Because the new email editor uses rich-text component for subject editing, to be ensure that the subject is always in plain text, we need to strip all tags. $subject = wp_strip_all_tags( $this->personalizer->personalize_transactional_content( $subject, $this ) ); } return $subject; } /** * Get email preheader. * * @return string */ public function get_preheader() { /** * Provides an opportunity to inspect and modify preheader for the email. * * @since 9.9.0 * * @param string $preheader Preheader of the email. * @param object|bool $object The object (ie, product or order) this email relates to, if any. * @param WC_Email $email WC_Email instance managing the email. */ $preheader = apply_filters( 'woocommerce_email_preheader' . $this->id, $this->format_string( $this->get_option_or_transient( 'preheader', '' ) ), $this->object, $this ); if ( $this->block_email_editor_enabled ) { $preheader = $this->personalizer->personalize_transactional_content( $preheader, $this ); } return $preheader; } /** * Get email heading. * * @return string */ public function get_heading() { /** * Provides an opportunity to inspect and modify heading for the email. * * @since 2.0.0 * * @param string $heading Heading to be added to the email. * @param object|bool $object The object (ie, product or order) this email relates to, if any. * @param WC_Email $email WC_Email instance managing the email. */ return apply_filters( 'woocommerce_email_heading_' . $this->id, $this->format_string( $this->get_option_or_transient( 'heading', $this->get_default_heading() ) ), $this->object, $this ); } /** * Get valid recipients. * * @return string */ public function get_recipient() { /** * Filter the recipient for the email. * * @since 2.0.0 * @since 3.7.0 Added $email parameter. * @param string $recipient Recipient. * @param object $object The object (ie, product or order) this email relates to, if any. * @param WC_Email $email WC_Email instance managing the email. */ $recipient = apply_filters( 'woocommerce_email_recipient_' . $this->id, $this->recipient, $this->object, $this ); $recipients = array_map( 'trim', explode( ',', $recipient ?? '' ) ); $recipients = array_filter( $recipients, 'is_email' ); return implode( ', ', $recipients ); } /** * Get valid Cc recipients. * * @return string */ public function get_cc_recipient() { /** * Filter the Cc recipient for the email. * * @since 9.8.0 * @param string $cc Cc recipient. * @param object $object The object (ie, product or order) this email relates to, if any. * @param WC_Email $email WC_Email instance managing the email. */ $cc = apply_filters( 'woocommerce_email_cc_recipient_' . $this->id, $this->cc, $this->object, $this ); $ccs = array_map( 'trim', explode( ',', $cc ?? '' ) ); $ccs = array_filter( $ccs, 'is_email' ); $ccs = array_map( 'sanitize_email', $ccs ); return implode( ', ', $ccs ); } /** * Get valid Bcc recipients. * * @return string */ public function get_bcc_recipient() { /** * Filter the Bcc recipient for the email. * * @since 9.8.0 * @param string $bcc Bcc recipient. * @param object $object The object (ie, product or order) this email relates to, if any. * @param WC_Email $email WC_Email instance managing the email. */ $bcc = apply_filters( 'woocommerce_email_bcc_recipient_' . $this->id, $this->bcc, $this->object, $this ); $bccs = array_map( 'trim', explode( ',', $bcc ?? '' ) ); $bccs = array_filter( $bccs, 'is_email' ); $bccs = array_map( 'sanitize_email', $bccs ); return implode( ', ', $bccs ); } /** * Get email headers. * * @return string */ public function get_headers() { $header = 'Content-Type: ' . $this->get_content_type() . "\r\n"; // For order notification emails sent to admin, always use customer's billing email as reply-to. if ( in_array( $this->id, array( 'new_order', 'cancelled_order', 'failed_order' ), true ) ) { if ( $this->object && $this->object->get_billing_email() && ( $this->object->get_billing_first_name() || $this->object->get_billing_last_name() ) ) { $header .= 'Reply-to: ' . $this->object->get_billing_first_name() . ' ' . $this->object->get_billing_last_name() . ' <' . $this->object->get_billing_email() . ">\r\n"; } } else { // Check if custom reply-to is enabled and configured for non-admin notification emails. $reply_to_enabled = $this->get_reply_to_enabled(); $reply_to_address = $this->get_reply_to_address(); $reply_to_name = $this->get_reply_to_name(); if ( $reply_to_enabled && ! empty( $reply_to_address ) && is_email( $reply_to_address ) ) { $reply_to_name = ! empty( $reply_to_name ) ? $reply_to_name : $this->get_from_name(); $header .= 'Reply-to: ' . $reply_to_name . ' <' . $reply_to_address . ">\r\n"; } elseif ( $this->get_from_address() && $this->get_from_name() ) { $header .= 'Reply-to: ' . $this->get_from_name() . ' <' . $this->get_from_address() . ">\r\n"; } } if ( FeaturesUtil::feature_is_enabled( 'email_improvements' ) ) { $cc = $this->get_cc_recipient(); if ( ! empty( $cc ) ) { $header .= 'Cc: ' . sanitize_text_field( $cc ) . "\r\n"; } $bcc = $this->get_bcc_recipient(); if ( ! empty( $bcc ) ) { $header .= 'Bcc: ' . sanitize_text_field( $bcc ) . "\r\n"; } } return apply_filters( 'woocommerce_email_headers', $header, $this->id, $this->object, $this ); } /** * Get email attachments. * * @return array */ public function get_attachments() { return apply_filters( 'woocommerce_email_attachments', array(), $this->id, $this->object, $this ); } /** * Return email type. * * @return string */ public function get_email_type() { $email_type = $this->email_type; /** * This filter is documented in templates/emails/email-styles.php * * @since 9.6.0 * @param bool $is_email_preview Whether the email is being previewed. */ $is_email_preview = apply_filters( 'woocommerce_is_email_preview', false ); // Transient is used for live email preview without saving the settings. if ( $is_email_preview ) { $transient = get_transient( "woocommerce_{$this->id}_email_type" ); $email_type = $transient ? $transient : $email_type; } return $email_type && class_exists( 'DOMDocument' ) ? $email_type : 'plain'; } /** * Get block editor email template content. * * @return string */ public function get_block_editor_email_template_content() { return wc_get_template_html( $this->template_block_content, array( 'order' => $this->object, 'sent_to_admin' => false, 'plain_text' => false, 'email' => $this, ) ); } /** * Get email content type. * * @param string $default_content_type Default wp_mail() content type. * @return string */ public function get_content_type( $default_content_type = '' ) { switch ( $this->get_email_type() ) { case 'html': $content_type = 'text/html'; break; case 'multipart': $content_type = 'multipart/alternative'; break; default: $content_type = 'text/plain'; break; } return apply_filters( 'woocommerce_email_content_type', $content_type, $this, $default_content_type ); } /** * Return the email's title * * @return string */ public function get_title() { return apply_filters( 'woocommerce_email_title', $this->title, $this ); } /** * Return the email's description * * @return string */ public function get_description() { return apply_filters( 'woocommerce_email_description', $this->description, $this ); } /** * Proxy to parent's get_option and attempt to localize the result using gettext. * * @param string $key Option key. * @param mixed $empty_value Value to use when option is empty. * @return string */ public function get_option( $key, $empty_value = null ) { $value = parent::get_option( $key, $empty_value ); return apply_filters( 'woocommerce_email_get_option', $value, $this, $value, $key, $empty_value ); } /** * Checks if this email is enabled and will be sent. * * @return bool */ public function is_enabled() { return apply_filters( 'woocommerce_email_enabled_' . $this->id, 'yes' === $this->enabled, $this->object, $this ); } /** * Checks if this email is manually sent * * @return bool */ public function is_manual() { return $this->manual; } /** * Checks if this email is customer focussed. * * @return bool */ public function is_customer_email() { return $this->customer_email; } /** * Get WordPress blog name. * * @return string */ public function get_blogname() { return wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ); } /** * Get email content. * * @return string */ public function get_content() { $this->sending = true; $block_email_content = $this->get_block_email_html_content(); if ( $block_email_content ) { $this->email_type = 'plain' === $this->email_type ? 'html' : $this->email_type; return $block_email_content; } if ( 'plain' === $this->get_email_type() ) { $email_content = wordwrap( preg_replace( $this->plain_search, $this->plain_replace, wp_strip_all_tags( $this->get_content_plain() ) ), 70 ); } else { $email_content = $this->get_content_html(); } return $email_content; } /** * Apply inline styles to dynamic content. * * We only inline CSS for html emails. * * @version 10.2.0 * @param string|null $content Content that will receive inline styles. * @return string */ public function style_inline( $content ) { if ( in_array( $this->get_content_type(), array( 'text/html', 'multipart/alternative' ), true ) ) { /** * Filter to allow the ability to override the email inline styling method. * * @since 10.2.0 * * @param callable $style_inline_callback The default email inline styling callback. * @param string|null $content Content that will receive inline styles. * @param WC_Email $email The WC_Email object. */ $style_inline_callback = apply_filters( 'woocommerce_mail_style_inline_callback', array( $this, 'apply_inline_style' ), $content, $this ); if ( ! is_callable( $style_inline_callback ) ) { $style_inline_callback = array( $this, 'apply_inline_style' ); } return call_user_func( $style_inline_callback, $content ); } return $content; } /** * Apply inline styles to dynamic content using Emogrifier library (if supported). * * @since 10.2.0 * @param string|null $content Content that will receive inline styles. * @return string */ private function apply_inline_style( $content ) { $css = ''; $css .= $this->get_must_use_css_styles(); $css .= "\n"; ob_start(); wc_get_template( 'emails/email-styles.php' ); $css .= ob_get_clean(); /** * Provides an opportunity to filter the CSS styles included in e-mails. * * @since 2.3.0 * * @param string $css CSS code. * @param \WC_Email $email E-mail instance. */ $css = apply_filters( 'woocommerce_email_styles', $css, $this ); $css_inliner_class = CssInliner::class; if ( $this->supports_emogrifier() && class_exists( $css_inliner_class ) ) { try { $css_inliner = CssInliner::fromHtml( $content )->inlineCss( $css ); /** * Action hook fired when an email content has been processed by Emogrifier CssInliner instance. * * @since 4.1.0 * * @param CssInliner $css_inliner CssInliner instance. * @param WC_Email $email WC_Email instance. */ do_action( 'woocommerce_emogrifier', $css_inliner, $this ); $dom_document = $css_inliner->getDomDocument(); // When the email is rendered in the block editor, we don't want to remove the elements with display: none. // The main reason is using preview text in the email body which is hidden by default. if ( ! $this->block_email_editor_enabled ) { HtmlPruner::fromDomDocument( $dom_document )->removeElementsWithDisplayNone(); } $content = CssToAttributeConverter::fromDomDocument( $dom_document ) ->convertCssToVisualAttributes() ->render(); } catch ( Exception $e ) { $logger = wc_get_logger(); $logger->error( $e->getMessage(), array( 'source' => 'emogrifier' ) ); } } else { $content = '<style type="text/css">' . $css . '</style>' . $content; } return $content; } /** * Returns CSS styles that should be included with all HTML e-mails, regardless of theme specific customizations. * * @since 9.1.0 * * @return string */ protected function get_must_use_css_styles(): string { $css = <<<'EOF' /* * Temporary measure until e-mail clients more properly support the correct styles. * See https://github.com/woocommerce/woocommerce/pull/47738. */ .screen-reader-text { display: none; } EOF; return $css; } /** * Return if emogrifier library is supported. * * @version 4.0.0 * @since 3.5.0 * @return bool */ protected function supports_emogrifier() { return class_exists( 'DOMDocument' ); } /** * Get the email content in plain text format. * * @return string */ public function get_content_plain() { return ''; } /** * Get the email content in HTML format. * * @return string */ public function get_content_html() { return ''; } /** * Get the from name for outgoing emails. * * @param string $from_name Default wp_mail() name associated with the "from" email address. * @return string */ public function get_from_name( $from_name = '' ) { $default = get_bloginfo( 'name', 'display' ); /** * Filters the "from" name for outgoing emails. * * @since 2.1.0 * * @param string|mixed $from_name The from name. * @param WC_Email $email Email object. * @param string $default_from_name Default from name. */ $from_name = apply_filters( 'woocommerce_email_from_name', get_option( 'woocommerce_email_from_name', $default ), $this, $from_name ); return wp_specialchars_decode( esc_html( $from_name ), ENT_QUOTES ); } /** * Get the from address for outgoing emails. * * @param string $from_email Default wp_mail() email address to send from. * @return string */ public function get_from_address( $from_email = '' ) { $from_email = apply_filters( 'woocommerce_email_from_address', get_option( 'woocommerce_email_from_address' ), $this, $from_email ); return sanitize_email( $from_email ); } /** * Check if reply-to is enabled for outgoing emails. * * @return bool */ public function get_reply_to_enabled() { /** * Filter whether reply-to is enabled for emails. * * @since 10.4.0 * @param bool $enabled Whether reply-to is enabled. * @param WC_Email $email WC_Email instance managing the email. */ $enabled = apply_filters( 'woocommerce_email_reply_to_enabled', 'yes' === get_option( 'woocommerce_email_reply_to_enabled', 'no' ), $this ); return (bool) $enabled; } /** * Get the reply-to name for outgoing emails. * * @param string $reply_to_name Default reply-to name. * @return string */ public function get_reply_to_name( $reply_to_name = '' ) { /** * Filter the reply-to name for emails. * * @since 10.4.0 * @param string $reply_to_name Reply-to name. * @param WC_Email $email WC_Email instance managing the email. * @param string $default_name Default reply-to name. */ $reply_to_name = apply_filters( 'woocommerce_email_reply_to_name', get_option( 'woocommerce_email_reply_to_name', '' ), $this, $reply_to_name ); return wp_specialchars_decode( sanitize_text_field( $reply_to_name ), ENT_QUOTES ); } /** * Get the reply-to address for outgoing emails. * * @param string $reply_to_email Default reply-to email address. * @return string */ public function get_reply_to_address( $reply_to_email = '' ) { /** * Filter the reply-to address for emails. * * @since 10.4.0 * @param string $reply_to_email Reply-to email address. * @param WC_Email $email WC_Email instance managing the email. * @param string $default_email Default reply-to email address. */ $reply_to_email = apply_filters( 'woocommerce_email_reply_to_address', get_option( 'woocommerce_email_reply_to_address', '' ), $this, $reply_to_email ); return sanitize_email( $reply_to_email ); } /** * Set the object for the outgoing email. * * @param object $object Object this email is for, e.g. customer, or product. * @return void */ public function set_object( $object ) { // phpcs:ignore Universal.NamingConventions.NoReservedKeywordParameterNames.objectFound $this->object = $object; } /** * Send an email. * * @param string $to Email to. * @param string $subject Email subject. * @param string $message Email message. * @param string $headers Email headers. * @param array $attachments Email attachments. * @return bool success */ public function send( $to, $subject, $message, $headers, $attachments ) { add_filter( 'wp_mail_from', array( $this, 'get_from_address' ) ); add_filter( 'wp_mail_from_name', array( $this, 'get_from_name' ) ); add_filter( 'wp_mail_content_type', array( $this, 'get_content_type' ) ); $message = apply_filters( 'woocommerce_mail_content', $this->style_inline( $message ) ); $mail_callback = apply_filters( 'woocommerce_mail_callback', 'wp_mail', $this ); $mail_callback_params = apply_filters( 'woocommerce_mail_callback_params', array( $to, wp_specialchars_decode( $subject ), $message, $headers, $attachments ), $this ); $return = $mail_callback( ...$mail_callback_params ); remove_filter( 'wp_mail_from', array( $this, 'get_from_address' ) ); remove_filter( 'wp_mail_from_name', array( $this, 'get_from_name' ) ); remove_filter( 'wp_mail_content_type', array( $this, 'get_content_type' ) ); // Clear the AltBody (if set) so that it does not leak across to different emails. $this->clear_alt_body_field(); /** * Action hook fired when an email is sent. * * @since 5.6.0 * @param bool $return Whether the email was sent successfully. * @param string $id Email ID. * @param WC_Email $email WC_Email instance. */ do_action( 'woocommerce_email_sent', $return, (string) $this->id, $this ); return $return; } /** * Initialise Settings Form Fields - these are generic email options most will use. */ public function init_form_fields() { /* translators: %s: list of placeholders */ $placeholder_text = sprintf( __( 'Available placeholders: %s', 'woocommerce' ), '<code>' . esc_html( implode( '</code>, <code>', array_keys( $this->placeholders ) ) ) . '</code>' ); $this->form_fields = array( 'enabled' => array( 'title' => __( 'Enable/Disable', 'woocommerce' ), 'type' => 'checkbox', 'label' => __( 'Enable this email notification', 'woocommerce' ), 'default' => 'yes', ), 'subject' => array( 'title' => __( 'Subject', 'woocommerce' ), 'type' => 'text', 'desc_tip' => true, 'description' => $placeholder_text, 'placeholder' => $this->get_default_subject(), 'default' => '', ), 'heading' => array( 'title' => __( 'Email heading', 'woocommerce' ), 'type' => 'text', 'desc_tip' => true, 'description' => $placeholder_text, 'placeholder' => $this->get_default_heading(), 'default' => '', ), 'additional_content' => array( 'title' => __( 'Additional content', 'woocommerce' ), 'description' => __( 'Text to appear below the main email content.', 'woocommerce' ) . ' ' . $placeholder_text, 'css' => 'width:400px; height: 75px;', 'placeholder' => __( 'N/A', 'woocommerce' ), 'type' => 'textarea', 'default' => $this->get_default_additional_content(), 'desc_tip' => true, ), 'email_type' => array( 'title' => __( 'Email type', 'woocommerce' ), 'type' => 'select', 'description' => __( 'Choose which format of email to send.', 'woocommerce' ), 'default' => 'html', 'class' => 'email_type wc-enhanced-select', 'options' => $this->get_email_type_options(), 'desc_tip' => true, ), ); if ( FeaturesUtil::feature_is_enabled( 'email_improvements' ) ) { $this->form_fields['cc'] = $this->get_cc_field(); $this->form_fields['bcc'] = $this->get_bcc_field(); } if ( $this->block_email_editor_enabled ) { $this->form_fields['preheader'] = $this->get_preheader_field(); } } /** * Get the cc field definition. * * @return array */ protected function get_cc_field() { return array( 'title' => __( 'Cc(s)', 'woocommerce' ), 'type' => 'text', /* translators: %s: admin email */ 'description' => __( 'Enter Cc recipients (comma-separated) for this email.', 'woocommerce' ), 'placeholder' => '', 'default' => '', 'desc_tip' => true, ); } /** * Get the bcc field definition. * * @return array */ protected function get_bcc_field() { return array( 'title' => __( 'Bcc(s)', 'woocommerce' ), 'type' => 'text', /* translators: %s: admin email */ 'description' => __( 'Enter Bcc recipients (comma-separated) for this email.', 'woocommerce' ), 'placeholder' => '', 'default' => '', 'desc_tip' => true, ); } /** * Get the preheader field definition. * * @return array */ protected function get_preheader_field() { return array( 'title' => __( 'Preheader', 'woocommerce' ), 'description' => __( 'Shown as a preview in the Inbox, next to the subject line. (Max 150 characters).', 'woocommerce' ), 'placeholder' => '', 'type' => 'text', 'default' => '', 'desc_tip' => true, ); } /** * Email type options. * * @return array */ public function get_email_type_options() { $types = array( 'plain' => __( 'Plain text', 'woocommerce' ) ); if ( class_exists( 'DOMDocument' ) ) { $types['html'] = __( 'HTML', 'woocommerce' ); $types['multipart'] = __( 'Multipart', 'woocommerce' ); } return $types; } /** * Admin Panel Options Processing. */ public function process_admin_options() { // Save regular options. parent::process_admin_options(); $post_data = $this->get_post_data(); // Save templates. if ( isset( $post_data['template_html_code'] ) ) { $this->save_template( $post_data['template_html_code'], $this->template_html ); } if ( isset( $post_data['template_plain_code'] ) ) { $this->save_template( $post_data['template_plain_code'], $this->template_plain ); } } /** * Get template. * * @param string $type Template type. Can be either 'template_html', 'template_plain' or 'template_block'. * @return string */ public function get_template( $type ) { $type = basename( $type ); if ( 'template_html' === $type ) { return $this->template_html; } elseif ( 'template_plain' === $type ) { return $this->template_plain; } elseif ( 'template_block' === $type ) { return $this->template_block; } return ''; } /** * Save the email templates. * * @since 2.4.0 * @param string $template_code Template code. * @param string $template_path Template path. */ protected function save_template( $template_code, $template_path ) { if ( current_user_can( 'edit_themes' ) && ! empty( $template_code ) && ! empty( $template_path ) ) { $saved = false; $file = $this->get_theme_template_file( $template_path ); $code = wp_unslash( $template_code ); if ( is_writeable( $file ) ) { // phpcs:ignore WordPress.VIP.FileSystemWritesDisallow.file_ops_is_writeable $f = fopen( $file, 'w+' ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_read_fopen if ( false !== $f ) { fwrite( $f, $code ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_read_fwrite fclose( $f ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_read_fclose $saved = true; } } if ( ! $saved ) { $redirect = add_query_arg( 'wc_error', rawurlencode( __( 'Could not write to template file.', 'woocommerce' ) ) ); wp_safe_redirect( $redirect ); exit; } wc_clear_template_cache(); } } /** * Get the template file in the current theme. * * @param string $template Template name. * * @return string */ public function get_theme_template_file( $template ) { return get_stylesheet_directory() . '/' . apply_filters( 'woocommerce_template_directory', 'woocommerce', $template ) . '/' . $template; } /** * Move template action. * * @param string $template_type Template type. */ protected function move_template_action( $template_type ) { $template = $this->get_template( $template_type ); if ( ! empty( $template ) ) { $theme_file = $this->get_theme_template_file( $template ); if ( wp_mkdir_p( dirname( $theme_file ) ) && ! file_exists( $theme_file ) ) { // Locate template file. $core_file = $this->template_base . $template; $template_file = apply_filters( 'woocommerce_locate_core_template', $core_file, $template, $this->template_base, $this->id ); // Copy template file. copy( $template_file, $theme_file ); /** * Action hook fired after copying email template file. * * @param string $template_type The copied template type * @param string $email The email object */ do_action( 'woocommerce_copy_email_template', $template_type, $this ); wc_clear_template_cache(); ?> <div class="updated"> <p><?php echo esc_html__( 'Template file copied to theme.', 'woocommerce' ); ?></p> </div> <?php } } } /** * Delete template action. * * @param string $template_type Template type. */ protected function delete_template_action( $template_type ) { $template = $this->get_template( $template_type ); if ( $template ) { if ( ! empty( $template ) ) { $theme_file = $this->get_theme_template_file( $template ); if ( file_exists( $theme_file ) ) { unlink( $theme_file ); // phpcs:ignore WordPress.VIP.FileSystemWritesDisallow.file_ops_unlink /** * Action hook fired after deleting template file. * * @param string $template The deleted template type * @param string $email The email object */ do_action( 'woocommerce_delete_email_template', $template_type, $this ); wc_clear_template_cache(); ?> <div class="updated"> <p><?php echo esc_html__( 'Template file deleted from theme.', 'woocommerce' ); ?></p> </div> <?php } } } } /** * Admin actions. */ protected function admin_actions() { // Handle any actions. if ( ( ! empty( $this->template_html ) || ! empty( $this->template_plain ) ) && ( ! empty( $_GET['move_template'] ) || ! empty( $_GET['delete_template'] ) ) && 'GET' === $_SERVER['REQUEST_METHOD'] // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotValidated ) { if ( empty( $_GET['_wc_email_nonce'] ) || ! wp_verify_nonce( wc_clean( wp_unslash( $_GET['_wc_email_nonce'] ) ), 'woocommerce_email_template_nonce' ) ) { wp_die( esc_html__( 'Action failed. Please refresh the page and retry.', 'woocommerce' ) ); } if ( ! current_user_can( 'edit_themes' ) ) { wp_die( esc_html__( 'You don’t have permission to do this.', 'woocommerce' ) ); } if ( ! empty( $_GET['move_template'] ) ) { $this->move_template_action( wc_clean( wp_unslash( $_GET['move_template'] ) ) ); } if ( ! empty( $_GET['delete_template'] ) ) { $this->delete_template_action( wc_clean( wp_unslash( $_GET['delete_template'] ) ) ); } } } /** * Admin Options. * * Setup the email settings screen. * Override this in your email. * * @since 1.0.0 */ public function admin_options() { // Do admin actions. $this->admin_actions(); ?> <?php wc_back_header( $this->get_title(), __( 'Return to emails', 'woocommerce' ), admin_url( 'admin.php?page=wc-settings&tab=email' ) ); ?> <?php echo wpautop( wp_kses_post( $this->get_description() ) ); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped ?> <?php /** * Action hook fired before displaying email settings. * * @param string $email The email object */ do_action( 'woocommerce_email_settings_before', $this ); ?> <table class="form-table"> <?php $this->generate_settings_html(); ?> </table> <?php /** * Action hook fired after displaying email settings. * * @param string $email The email object */ do_action( 'woocommerce_email_settings_after', $this ); ?> <?php if ( current_user_can( 'edit_themes' ) && ( ! empty( $this->template_html ) || ! empty( $this->template_plain ) ) ) { ?> <div id="template"> <?php $templates = array( 'template_html' => __( 'HTML template', 'woocommerce' ), 'template_plain' => __( 'Plain text template', 'woocommerce' ), ); foreach ( $templates as $template_type => $title ) : $template = $this->get_template( $template_type ); if ( empty( $template ) ) { continue; } $local_file = $this->get_theme_template_file( $template ); $core_file = $this->template_base . $template; $template_file = apply_filters( 'woocommerce_locate_core_template', $core_file, $template, $this->template_base, $this->id ); $template_dir = apply_filters( 'woocommerce_template_directory', 'woocommerce', $template ); ?> <div class="template <?php echo esc_attr( $template_type ); ?>"> <h4><?php echo wp_kses_post( $title ); ?></h4> <?php if ( file_exists( $local_file ) ) : ?> <p> <a href="#" class="button toggle_editor"></a> <?php if ( is_writable( $local_file ) ) : // phpcs:ignore WordPress.VIP.FileSystemWritesDisallow.file_ops_is_writable ?> <a href="<?php echo esc_url( wp_nonce_url( remove_query_arg( array( 'move_template', 'saved' ), add_query_arg( 'delete_template', $template_type ) ), 'woocommerce_email_template_nonce', '_wc_email_nonce' ) ); ?>" class="delete_template button"> <?php esc_html_e( 'Delete template file', 'woocommerce' ); ?> </a> <?php endif; ?> <?php /* translators: %s: Path to template file */ printf( esc_html__( 'This template has been overridden by your theme and can be found in: %s.', 'woocommerce' ), '<code>' . esc_html( trailingslashit( basename( get_stylesheet_directory() ) ) . $template_dir . '/' . $template ) . '</code>' ); ?> </p> <div class="editor" style="display:none"> <textarea class="code" cols="25" rows="20" <?php if ( ! is_writable( $local_file ) ) : // phpcs:ignore WordPress.VIP.FileSystemWritesDisallow.file_ops_is_writable ?> readonly="readonly" disabled="disabled" <?php else : ?> data-name="<?php echo esc_attr( $template_type ) . '_code'; ?>"<?php endif; ?>><?php echo esc_html( file_get_contents( $local_file ) ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents ?></textarea> </div> <?php elseif ( file_exists( $template_file ) ) : ?> <p> <a href="#" class="button toggle_editor"></a> <?php $emails_dir = get_stylesheet_directory() . '/' . $template_dir . '/emails'; $templates_dir = get_stylesheet_directory() . '/' . $template_dir; $theme_dir = get_stylesheet_directory(); if ( is_dir( $emails_dir ) ) { $target_dir = $emails_dir; } elseif ( is_dir( $templates_dir ) ) { $target_dir = $templates_dir; } else { $target_dir = $theme_dir; } if ( is_writable( $target_dir ) ) : // phpcs:ignore WordPress.VIP.FileSystemWritesDisallow.file_ops_is_writable ?> <a href="<?php echo esc_url( wp_nonce_url( remove_query_arg( array( 'delete_template', 'saved' ), add_query_arg( 'move_template', $template_type ) ), 'woocommerce_email_template_nonce', '_wc_email_nonce' ) ); ?>" class="button"> <?php esc_html_e( 'Copy file to theme', 'woocommerce' ); ?> </a> <?php endif; ?> <?php /* translators: 1: Path to template file 2: Path to theme folder */ printf( esc_html__( 'To override and edit this email template copy %1$s to your theme folder: %2$s.', 'woocommerce' ), '<code>' . esc_html( plugin_basename( $template_file ) ) . '</code>', '<code>' . esc_html( trailingslashit( basename( get_stylesheet_directory() ) ) . $template_dir . '/' . $template ) . '</code>' ); ?> </p> <div class="editor" style="display:none"> <textarea class="code" readonly="readonly" disabled="disabled" cols="25" rows="20"><?php echo esc_html( file_get_contents( $template_file ) ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents ?></textarea> </div> <?php else : ?> <p><?php esc_html_e( 'File was not found.', 'woocommerce' ); ?></p> <?php endif; ?> </div> <?php endforeach; ?> </div> <?php $handle = 'wc-admin-settings-email'; wp_register_script( $handle, '', array( 'jquery' ), WC_VERSION, array( 'in_footer' => true ) ); wp_enqueue_script( $handle ); wp_add_inline_script( $handle, "jQuery( 'select.email_type' ).on( 'change', function() { const val = jQuery( this ).val(); jQuery( '.template_plain, .template_html' ).show(); if ( val != 'multipart' && val != 'html' ) { jQuery('.template_html').hide(); } if ( val != 'multipart' && val != 'plain' ) { jQuery('.template_plain').hide(); } }).trigger( 'change' ); const view = '" . esc_js( __( 'View template', 'woocommerce' ) ) . "'; const hide = '" . esc_js( __( 'Hide template', 'woocommerce' ) ) . "'; jQuery( 'a.toggle_editor' ).text( view ).on( 'click', function() { let label = hide; if ( jQuery( this ).closest(' .template' ).find( '.editor' ).is(':visible') ) { label = view; } jQuery( this ).text( label ).closest(' .template' ).find( '.editor' ).slideToggle(); return false; } ); jQuery( 'a.delete_template' ).on( 'click', function() { if ( window.confirm('" . esc_js( __( 'Are you sure you want to delete this template file?', 'woocommerce' ) ) . "') ) { return true; } return false; }); jQuery( '.editor textarea' ).on( 'change', function() { const name = jQuery( this ).attr( 'data-name' ); if ( name ) { jQuery( this ).attr( 'name', name ); } });" ); } } /** * Clears the PhpMailer AltBody field, to prevent that content from leaking across emails. */ private function clear_alt_body_field(): void { global $phpmailer; if ( $phpmailer instanceof PHPMailer\PHPMailer\PHPMailer ) { $phpmailer->AltBody = ''; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase } } /** * Get an option or transient for email preview. * * @param string $key Option key. * @param mixed $empty_value Value to use when option is empty. */ protected function get_option_or_transient( string $key, $empty_value = null ) { $option = $this->get_option( $key, $empty_value ); /** * This filter is documented in templates/emails/email-styles.php * * @since 9.6.0 * @param bool $is_email_preview Whether the email is being previewed. */ $is_email_preview = apply_filters( 'woocommerce_is_email_preview', false ); if ( $is_email_preview ) { $plugin_id = $this->plugin_id; $email_id = $this->id; $transient = get_transient( "{$plugin_id}{$email_id}_{$key}" ); if ( false !== $transient ) { $option = $transient ? $transient : $empty_value; } } return $option; } /** * Gerenerates the HTML content for the email from a block based email. * and if so, it renders the block email content. * * @return string|null */ private function get_block_email_html_content(): ?string { if ( ! $this->block_email_editor_enabled ) { return null; } /** Service for rendering emails from block content @var BlockEmailRenderer $renderer */ $renderer = wc_get_container()->get( BlockEmailRenderer::class ); return $renderer->maybe_render_block_email( $this ); } /** * Prevent lazy loading on attachment images in email context by adding skip classes. * This is hooked into the wp_get_attachment_image_attributes filter. * * @param array $attributes The image attributes array. * @return array The modified image attributes array. */ public function prevent_lazy_loading_on_attachment( $attributes ) { // Only process if we're currently sending an email. if ( ! $this->sending ) { return $attributes; } // Skip classes to prevent lazy loading plugins from applying lazy loading. // These are the most common skip classes used by popular lazy loading plugins. $skip_classes = array( 'skip-lazy', 'no-lazyload', 'lazyload-disabled', 'no-lazy', 'skip-lazyload' ); // Add skip classes to prevent lazy loading plugins from applying lazy loading. if ( isset( $attributes['class'] ) ) { $classes = array_filter( array_map( 'trim', explode( ' ', $attributes['class'] ) ) ); $classes = array_unique( array_merge( $classes, $skip_classes ) ); $attributes['class'] = implode( ' ', $classes ); } else { // No class attribute exists, add one with skip classes. $attributes['class'] = implode( ' ', $skip_classes ); } // Add data-skip-lazy attribute as an additional safeguard. $attributes['data-skip-lazy'] = 'true'; return $attributes; } } class-wc-email-customer-note.php 0000777 00000012225 15252364676 0012711 0 ustar 00 <?php /** * Class WC_Email_Customer_Note file. * * @package WooCommerce\Emails */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } if ( ! class_exists( 'WC_Email_Customer_Note', false ) ) : /** * Customer Note Order Email. * * Customer note emails are sent when you add a note to an order. * * @class WC_Email_Customer_Note * @version 3.5.0 * @package WooCommerce\Classes\Emails * @extends WC_Email */ class WC_Email_Customer_Note extends WC_Email { /** * Customer note. * * @var string */ public $customer_note; /** * Constructor. */ public function __construct() { $this->id = 'customer_note'; $this->customer_email = true; $this->title = __( 'Customer note', 'woocommerce' ); $this->email_group = 'order-changes'; $this->template_html = 'emails/customer-note.php'; $this->template_plain = 'emails/plain/customer-note.php'; $this->placeholders = array( '{order_date}' => '', '{order_number}' => '', ); // Triggers. add_action( 'woocommerce_new_customer_note_notification', array( $this, 'trigger' ) ); // Call parent constructor. parent::__construct(); // Must be after parent's constructor which sets `email_improvements_enabled` property. $this->description = $this->email_improvements_enabled ? __( 'Send an email to customers notifying them when you’ve added a note to their order', 'woocommerce' ) : __( 'Customer note emails are sent when you add a note to an order.', 'woocommerce' ); if ( $this->block_email_editor_enabled ) { $this->title = __( 'Customer note added', 'woocommerce' ); $this->description = __( 'Notifies customers when you’ve added a note to their order.', 'woocommerce' ); } } /** * Get email subject. * * @since 3.1.0 * @return string */ public function get_default_subject() { return $this->email_improvements_enabled ? __( 'A note has been added to your order from {site_title}', 'woocommerce' ) : __( 'Note added to your {site_title} order from {order_date}', 'woocommerce' ); } /** * Get email heading. * * @since 3.1.0 * @return string */ public function get_default_heading() { return __( 'A note has been added to your order', 'woocommerce' ); } /** * Trigger. * * @param array $args Email arguments. */ public function trigger( $args ) { $this->setup_locale(); if ( ! empty( $args ) ) { $defaults = array( 'order_id' => '', 'customer_note' => '', ); $args = wp_parse_args( $args, $defaults ); $order_id = $args['order_id']; $customer_note = $args['customer_note']; if ( $order_id ) { $this->object = wc_get_order( $order_id ); if ( $this->object ) { $this->recipient = $this->object->get_billing_email(); $this->customer_note = $customer_note; $this->placeholders['{order_date}'] = wc_format_datetime( $this->object->get_date_created() ); $this->placeholders['{order_number}'] = $this->object->get_order_number(); } } } if ( $this->is_enabled() && $this->get_recipient() ) { $this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() ); } $this->restore_locale(); } /** * Get content html. * * @return string */ public function get_content_html() { return wc_get_template_html( $this->template_html, array( 'order' => $this->object, 'email_heading' => $this->get_heading(), 'additional_content' => $this->get_additional_content(), 'customer_note' => $this->customer_note, 'sent_to_admin' => false, 'plain_text' => false, 'email' => $this, ) ); } /** * Get content plain. * * @return string */ public function get_content_plain() { return wc_get_template_html( $this->template_plain, array( 'order' => $this->object, 'email_heading' => $this->get_heading(), 'additional_content' => $this->get_additional_content(), 'customer_note' => $this->customer_note, 'sent_to_admin' => false, 'plain_text' => true, 'email' => $this, ) ); } /** * Default content to show below main email content. * * @since 3.7.0 * @return string */ public function get_default_additional_content() { return $this->email_improvements_enabled ? __( 'Thanks again! If you need any help with your order, please contact us at {store_email}.', 'woocommerce' ) : __( 'Thanks for reading.', 'woocommerce' ); } /** * Get block editor email template content. * * @return string */ public function get_block_editor_email_template_content() { return wc_get_template_html( $this->template_block_content, array( 'order' => $this->object, 'customer_note' => $this->customer_note, 'sent_to_admin' => false, 'plain_text' => false, 'email' => $this, ) ); } } endif; return new WC_Email_Customer_Note(); class-wc-email-failed-order.php 0000777 00000017406 15252364676 0012450 0 ustar 00 <?php /** * Class WC_Email_Failed_Order file. * * @package WooCommerce\Emails */ use Automattic\WooCommerce\Utilities\FeaturesUtil; if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'WC_Email_Failed_Order', false ) ) : /** * Failed Order Email. * * An email sent to the admin when payment fails to go through. * * @class WC_Email_Failed_Order * @version 2.5.0 * @package WooCommerce\Classes\Emails * @extends WC_Email */ class WC_Email_Failed_Order extends WC_Email { /** * Constructor. */ public function __construct() { $this->id = 'failed_order'; $this->title = __( 'Failed order', 'woocommerce' ); $this->email_group = 'orders'; $this->template_html = 'emails/admin-failed-order.php'; $this->template_plain = 'emails/plain/admin-failed-order.php'; $this->placeholders = array( '{order_date}' => '', '{order_number}' => '', ); // Triggers for this email. add_action( 'woocommerce_order_status_pending_to_failed_notification', array( $this, 'trigger' ), 10, 2 ); add_action( 'woocommerce_order_status_on-hold_to_failed_notification', array( $this, 'trigger' ), 10, 2 ); // Call parent constructor. parent::__construct(); // Must be after parent's constructor which sets `email_improvements_enabled` property. $this->description = $this->email_improvements_enabled ? __( 'Select who should be notified if an order that was previously processing or on-hold has failed.', 'woocommerce' ) : __( 'Failed order emails are sent to chosen recipient(s) when orders have been marked failed (if they were previously pending or on-hold).', 'woocommerce' ); // Other settings. $this->recipient = $this->get_option( 'recipient', get_option( 'admin_email' ) ); if ( $this->block_email_editor_enabled ) { $this->description = __( 'Notifies admins when an order that was processing or on hold has failed.', 'woocommerce' ); } } /** * Get email subject. * * @since 3.1.0 * @return string */ public function get_default_subject() { return __( '[{site_title}]: Order #{order_number} has failed', 'woocommerce' ); } /** * Get email heading. * * @since 3.1.0 * @return string */ public function get_default_heading() { return $this->email_improvements_enabled ? __( 'Order failed: #{order_number}', 'woocommerce' ) : __( 'Order Failed: #{order_number}', 'woocommerce' ); } /** * Trigger the sending of this email. * * @param int $order_id The order ID. * @param WC_Order|false $order Order object. */ public function trigger( $order_id, $order = false ) { $this->setup_locale(); if ( $order_id && ! is_a( $order, 'WC_Order' ) ) { $order = wc_get_order( $order_id ); } if ( is_a( $order, 'WC_Order' ) ) { $this->object = $order; $this->placeholders['{order_date}'] = wc_format_datetime( $this->object->get_date_created() ); $this->placeholders['{order_number}'] = $this->object->get_order_number(); } if ( $this->is_enabled() && $this->get_recipient() ) { $this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() ); } $this->restore_locale(); } /** * Get content html. * * @return string */ public function get_content_html() { return wc_get_template_html( $this->template_html, array( 'order' => $this->object, 'email_heading' => $this->get_heading(), 'additional_content' => $this->get_additional_content(), 'sent_to_admin' => true, 'plain_text' => false, 'email' => $this, ) ); } /** * Get content plain. * * @return string */ public function get_content_plain() { return wc_get_template_html( $this->template_plain, array( 'order' => $this->object, 'email_heading' => $this->get_heading(), 'additional_content' => $this->get_additional_content(), 'sent_to_admin' => true, 'plain_text' => true, 'email' => $this, ) ); } /** * Get block editor email template content. * * @return string */ public function get_block_editor_email_template_content() { return wc_get_template_html( $this->template_block_content, array( 'order' => $this->object, 'sent_to_admin' => true, 'plain_text' => false, 'email' => $this, ) ); } /** * Default content to show below main email content. * * @since 3.7.0 * @return string */ public function get_default_additional_content() { return $this->email_improvements_enabled ? __( 'We hope they’ll be back soon! Read more about <a href="https://woocommerce.com/document/managing-orders/">troubleshooting failed payments</a>.', 'woocommerce' ) : __( 'Hopefully they’ll be back. Read more about <a href="https://woocommerce.com/document/managing-orders/">troubleshooting failed payments</a>.', 'woocommerce' ); } /** * Initialise settings form fields. */ public function init_form_fields() { /* translators: %s: list of placeholders */ $placeholder_text = sprintf( __( 'Available placeholders: %s', 'woocommerce' ), '<code>' . esc_html( implode( '</code>, <code>', array_keys( $this->placeholders ) ) ) . '</code>' ); $this->form_fields = array( 'enabled' => array( 'title' => __( 'Enable/Disable', 'woocommerce' ), 'type' => 'checkbox', 'label' => __( 'Enable this email notification', 'woocommerce' ), 'default' => 'yes', ), 'recipient' => array( 'title' => __( 'Recipient(s)', 'woocommerce' ), 'type' => 'text', /* translators: %s: WP admin email */ 'description' => sprintf( __( 'Enter recipients (comma separated) for this email. Defaults to %s.', 'woocommerce' ), '<code>' . esc_attr( get_option( 'admin_email' ) ) . '</code>' ), 'placeholder' => '', 'default' => '', 'desc_tip' => true, ), 'subject' => array( 'title' => __( 'Subject', 'woocommerce' ), 'type' => 'text', 'desc_tip' => true, 'description' => $placeholder_text, 'placeholder' => $this->get_default_subject(), 'default' => '', ), 'heading' => array( 'title' => __( 'Email heading', 'woocommerce' ), 'type' => 'text', 'desc_tip' => true, 'description' => $placeholder_text, 'placeholder' => $this->get_default_heading(), 'default' => '', ), 'additional_content' => array( 'title' => __( 'Additional content', 'woocommerce' ), 'description' => __( 'Text to appear below the main email content.', 'woocommerce' ) . ' ' . $placeholder_text, 'css' => 'width:400px; height: 75px;', 'placeholder' => __( 'N/A', 'woocommerce' ), 'type' => 'textarea', 'default' => $this->get_default_additional_content(), 'desc_tip' => true, ), 'email_type' => array( 'title' => __( 'Email type', 'woocommerce' ), 'type' => 'select', 'description' => __( 'Choose which format of email to send.', 'woocommerce' ), 'default' => 'html', 'class' => 'email_type wc-enhanced-select', 'options' => $this->get_email_type_options(), 'desc_tip' => true, ), ); if ( FeaturesUtil::feature_is_enabled( 'email_improvements' ) ) { $this->form_fields['cc'] = $this->get_cc_field(); $this->form_fields['bcc'] = $this->get_bcc_field(); } if ( $this->block_email_editor_enabled ) { $this->form_fields['preheader'] = $this->get_preheader_field(); } } } endif; return new WC_Email_Failed_Order(); class-wc-email-customer-pos-refunded-order.php 0000777 00000050101 15252364676 0015443 0 ustar 00 <?php /** * Class WC_Email_Customer_POS_Refunded_Order file. * * @package WooCommerce\Emails */ use Automattic\WooCommerce\Internal\Email\OrderPriceFormatter; use Automattic\WooCommerce\Internal\Orders\PointOfSaleOrderUtil; use Automattic\WooCommerce\Internal\Settings\PointOfSaleDefaultSettings; use Automattic\WooCommerce\Utilities\FeaturesUtil; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } if ( ! class_exists( 'WC_Email_Customer_POS_Refunded_Order', false ) ) : /** * Customer Refunded Order Email. * * Order refunded emails are sent to the customer when the order is marked refunded. * * @class WC_Email_Customer_POS_Refunded_Order * @version 3.5.0 * @package WooCommerce\Classes\Emails * @extends WC_Email */ class WC_Email_Customer_POS_Refunded_Order extends WC_Email { /** * Refund order. * * @var WC_Order|bool */ public $refund; /** * Is the order partial refunded? * * @var bool */ public $partial_refund; /** * Constructor. */ public function __construct() { $this->customer_email = true; $this->id = 'customer_pos_refunded_order'; $this->title = __( 'POS refunded order', 'woocommerce' ); $this->email_group = 'payments'; $this->template_html = 'emails/customer-pos-refunded-order.php'; $this->template_plain = 'emails/plain/customer-pos-refunded-order.php'; $this->placeholders = array( '{order_date}' => '', '{order_number}' => '', ); // Call parent constructor. parent::__construct(); // Must be after parent's constructor which sets `email_improvements_enabled` property. $this->description = $this->email_improvements_enabled ? __( 'Let customers know when a full or partial refund is on its way to them for their POS order.', 'woocommerce' ) : __( 'Order refunded emails are sent to customers when their POS orders are refunded.', 'woocommerce' ); $this->disable_default_refund_emails_for_pos_orders(); $this->register_refund_email_triggers(); if ( $this->block_email_editor_enabled ) { $this->title = __( 'POS order refunded', 'woocommerce' ); $this->description = __( 'Notifies customers when a full or partial refund has been issued for their in-person (POS) order.', 'woocommerce' ); } } /** * Get email subject. * * @param bool $partial Whether it is a partial refund or a full refund. * @since 3.1.0 * @return string */ public function get_default_subject( $partial = false ) { $store_name = $this->get_pos_store_name(); if ( $partial ) { /* translators: %1$s: Store name, %2$s: Order number */ return sprintf( __( 'Your %1$s order #%2$s has been partially refunded', 'woocommerce' ), esc_html( $store_name ), '{order_number}' ); } else { /* translators: %1$s: Store name, %2$s: Order number */ return sprintf( __( 'Your %1$s order #%2$s has been refunded', 'woocommerce' ), esc_html( $store_name ), '{order_number}' ); } } /** * Get email heading. * * @param bool $partial Whether it is a partial refund or a full refund. * @since 3.1.0 * @return string */ public function get_default_heading( $partial = false ) { if ( $partial ) { return $this->email_improvements_enabled ? __( 'Partial refund: Order {order_number}', 'woocommerce' ) : __( 'Partial Refund: Order {order_number}', 'woocommerce' ); } else { return $this->email_improvements_enabled ? __( 'Order refunded: {order_number}', 'woocommerce' ) : __( 'Order Refunded: {order_number}', 'woocommerce' ); } } /** * Get email subject. * * @return string */ public function get_subject() { if ( $this->partial_refund ) { $subject = $this->get_option( 'subject_partial', $this->get_default_subject( true ) ); } else { $subject = $this->get_option( 'subject_full', $this->get_default_subject() ); } /** * Filter the email subject for customer refunded order. * * @param string $subject The email subject. * @param WC_Order $order Order object. * @param WC_Email_Customer_POS_Refunded_Order $email Email object. * @since 3.7.0 */ return apply_filters( 'woocommerce_email_subject_customer_refunded_order', $this->format_string( $subject ), $this->object, $this ); } /** * Get email heading. * * @return string */ public function get_heading() { if ( $this->partial_refund ) { $heading = $this->get_option( 'heading_partial', $this->get_default_heading( true ) ); } else { $heading = $this->get_option( 'heading_full', $this->get_default_heading() ); } /** * Filter the email heading for customer refunded order. * * @param string $heading The email heading. * @param WC_Order $order Order object. * @param WC_Email_Customer_POS_Refunded_Order $email Email object. * @since 3.7.0 */ return apply_filters( 'woocommerce_email_heading_customer_refunded_order', $this->format_string( $heading ), $this->object, $this ); } /** * Set email strings. * * @param bool $partial_refund Whether it is a partial refund or a full refund. * @deprecated 3.1.0 Unused. */ public function set_email_strings( $partial_refund = false ) {} /** * Full refund notification. * * @param int $order_id Order ID. * @param int $refund_id Refund ID. * * @internal For exclusive usage within this class, backwards compatibility not guaranteed. */ public function trigger_full( $order_id, $refund_id = null ) { $this->trigger( $order_id, false, $refund_id ); } /** * Partial refund notification. * * @param int $order_id Order ID. * @param int $refund_id Refund ID. * * @internal For exclusive usage within this class, backwards compatibility not guaranteed. */ public function trigger_partial( $order_id, $refund_id = null ) { $this->trigger( $order_id, true, $refund_id ); } /** * Trigger. * * @param int $order_id Order ID. * @param bool $partial_refund Whether it is a partial refund or a full refund. * @param int $refund_id Refund ID. */ private function trigger( $order_id, $partial_refund = false, $refund_id = null ) { if ( ! $order_id ) { return; } // Only trigger for POS orders. $order = wc_get_order( $order_id ); if ( ! $order || ! PointOfSaleOrderUtil::is_pos_order( $order ) ) { return; } $this->setup_locale(); $this->partial_refund = $partial_refund; $this->object = $order; $this->recipient = $this->object->get_billing_email(); $this->placeholders['{order_date}'] = wc_format_datetime( $this->object->get_date_created() ); $this->placeholders['{order_number}'] = $this->object->get_order_number(); if ( ! empty( $refund_id ) ) { $this->refund = wc_get_order( $refund_id ); } else { $this->refund = false; } if ( $this->is_enabled() && $this->get_recipient() ) { $this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() ); } $this->restore_locale(); } /** * Get content html. * * @return string */ public function get_content_html() { $this->add_pos_customizations(); add_action( 'woocommerce_pos_email_header', array( $this, 'email_header' ) ); add_action( 'woocommerce_pos_email_footer', array( $this, 'email_footer' ) ); $content = wc_get_template_html( $this->template_html, array( 'order' => $this->object, 'refund' => $this->refund, 'partial_refund' => $this->partial_refund, 'email_heading' => $this->get_heading(), 'additional_content' => $this->get_additional_content(), 'pos_store_name' => $this->get_pos_store_name(), 'pos_store_email' => $this->get_pos_store_email(), 'pos_store_phone_number' => $this->get_pos_store_phone_number(), 'pos_store_address' => $this->get_pos_store_address(), 'pos_refund_returns_policy' => $this->get_pos_refund_returns_policy(), 'blogname' => $this->get_blogname(), 'sent_to_admin' => false, 'plain_text' => false, 'email' => $this, ) ); $this->remove_pos_customizations(); remove_action( 'woocommerce_pos_email_header', array( $this, 'email_header' ) ); remove_action( 'woocommerce_pos_email_footer', array( $this, 'email_footer' ) ); return $content; } /** * Get content plain. * * @return string */ public function get_content_plain() { $this->add_pos_customizations(); $content = wc_get_template_html( $this->template_plain, array( 'order' => $this->object, 'refund' => $this->refund, 'partial_refund' => $this->partial_refund, 'email_heading' => $this->get_heading(), 'additional_content' => $this->get_additional_content(), 'pos_store_name' => $this->get_pos_store_name(), 'pos_store_email' => $this->get_pos_store_email(), 'pos_store_phone_number' => $this->get_pos_store_phone_number(), 'pos_store_address' => $this->get_pos_store_address(), 'pos_refund_returns_policy' => $this->get_pos_refund_returns_policy(), 'blogname' => $this->get_blogname(), 'sent_to_admin' => false, 'plain_text' => true, 'email' => $this, ) ); $this->remove_pos_customizations(); return $content; } /** * Get block editor email template content. * * @return string */ public function get_block_editor_email_template_content() { $this->add_pos_customizations(); return wc_get_template_html( $this->template_block_content, array( 'order' => $this->object, 'refund' => $this->refund, 'partial_refund' => $this->partial_refund, 'sent_to_admin' => false, 'plain_text' => false, 'email' => $this, ) ); } /** * Initialise settings form fields. */ public function init_form_fields() { /* translators: %s: list of placeholders */ $placeholder_text = sprintf( __( 'Available placeholders: %s', 'woocommerce' ), '<code>' . esc_html( implode( '</code>, <code>', array_keys( $this->placeholders ) ) ) . '</code>' ); $this->form_fields = array( 'enabled' => array( 'title' => __( 'Enable/Disable', 'woocommerce' ), 'type' => 'checkbox', 'label' => __( 'Enable this email notification', 'woocommerce' ), 'default' => 'yes', ), 'subject_full' => array( 'title' => __( 'Full refund subject', 'woocommerce' ), 'type' => 'text', 'desc_tip' => true, 'description' => $placeholder_text, 'placeholder' => $this->get_default_subject(), 'default' => '', ), 'subject_partial' => array( 'title' => __( 'Partial refund subject', 'woocommerce' ), 'type' => 'text', 'desc_tip' => true, 'description' => $placeholder_text, 'placeholder' => $this->get_default_subject( true ), 'default' => '', ), 'heading_full' => array( 'title' => __( 'Full refund email heading', 'woocommerce' ), 'type' => 'text', 'desc_tip' => true, 'description' => $placeholder_text, 'placeholder' => $this->get_default_heading(), 'default' => '', ), 'heading_partial' => array( 'title' => __( 'Partial refund email heading', 'woocommerce' ), 'type' => 'text', 'desc_tip' => true, 'description' => $placeholder_text, 'placeholder' => $this->get_default_heading( true ), 'default' => '', ), 'additional_content' => array( 'title' => __( 'Additional content', 'woocommerce' ), 'description' => __( 'Text to appear below the main email content.', 'woocommerce' ) . ' ' . $placeholder_text, 'css' => 'width:400px; height: 75px;', 'placeholder' => __( 'N/A', 'woocommerce' ), 'type' => 'textarea', 'default' => $this->get_default_additional_content(), 'desc_tip' => true, ), 'email_type' => array( 'title' => __( 'Email type', 'woocommerce' ), 'type' => 'select', 'description' => __( 'Choose which format of email to send.', 'woocommerce' ), 'default' => 'html', 'class' => 'email_type wc-enhanced-select', 'options' => $this->get_email_type_options(), 'desc_tip' => true, ), ); if ( FeaturesUtil::feature_is_enabled( 'email_improvements' ) ) { $this->form_fields['cc'] = $this->get_cc_field(); $this->form_fields['bcc'] = $this->get_bcc_field(); } if ( $this->block_email_editor_enabled ) { $this->form_fields['preheader'] = $this->get_preheader_field(); } } /** * Add actions and filters before generating email content. */ private function add_pos_customizations() { // Add action to display unit price in the beginning of the order item meta. add_action( 'woocommerce_order_item_meta_start', array( $this, 'add_unit_price' ), 10, 4 ); // Add filter to include additional details in the order item totals table. add_filter( 'woocommerce_get_order_item_totals', array( $this, 'order_item_totals' ), 10, 3 ); // Add filter for custom footer text with highest priority to run before the default footer text filtering in `WC_Emails`. add_filter( 'woocommerce_email_footer_text', array( $this, 'replace_footer_placeholders' ), 1, 2 ); } /** * Remove actions and filters after generating email content. */ private function remove_pos_customizations() { // Remove actions and filters after generating content to avoid affecting other emails. remove_action( 'woocommerce_order_item_meta_start', array( $this, 'add_unit_price' ), 10 ); remove_filter( 'woocommerce_get_order_item_totals', array( $this, 'order_item_totals' ), 10 ); remove_filter( 'woocommerce_email_footer_text', array( $this, 'replace_footer_placeholders' ), 1 ); } /** * Get the email header. * * @param mixed $email_heading Heading for the email. * * @internal For exclusive usage within this class, backwards compatibility not guaranteed. */ public function email_header( $email_heading ) { wc_get_template( 'emails/email-header.php', array( 'email_heading' => $email_heading, 'store_name' => $this->get_pos_store_name(), ) ); } /** * Get the email footer. * * @param mixed $email Email object. * * @internal For exclusive usage within this class, backwards compatibility not guaranteed. */ public function email_footer( $email ) { wc_get_template( 'emails/email-footer.php', array( 'email' => $email, ) ); } /** * Add unit price to order item meta start position. * * @param int $item_id Order item ID. * @param array $item Order item data. * @param WC_Order $order Order object. */ public function add_unit_price( $item_id, $item, $order ) { $unit_price = OrderPriceFormatter::get_formatted_item_subtotal( $order, $item, get_option( 'woocommerce_tax_display_cart' ) ); echo wp_kses_post( '<br /><small>' . $unit_price . '</small>' ); } /** * Disable default WooCommerce refund emails for POS orders. * The core refund email IDs are in WC_Email_Customer_Refunded_Order's trigger method. * * This method adds filters to prevent the default WooCommerce refund emails * from being sent for orders created through the Point of Sale system. * Instead, the POS-specific refund emails will be used. */ private function disable_default_refund_emails_for_pos_orders() { add_filter( 'woocommerce_email_enabled_customer_partially_refunded_order', array( $this, 'disable_default_refund_email_for_pos_orders' ), 10, 3 ); add_filter( 'woocommerce_email_enabled_customer_refunded_order', array( $this, 'disable_default_refund_email_for_pos_orders' ), 10, 3 ); } /** * Disable the default WooCommerce refund email for POS orders. * * @param bool $enabled Whether the email is enabled. * @param WC_Order|null $order The order object. * @param WC_Email|null $email The email object. * @return bool * * @internal For exclusive usage within this class, backwards compatibility not guaranteed. */ public function disable_default_refund_email_for_pos_orders( $enabled, $order, $email ) { if ( $order && PointOfSaleOrderUtil::is_pos_order( $order ) ) { return false; } return $enabled; } /** * Register triggers for POS refund emails. * * This method adds actions to trigger the refund emails for POS orders. * It ensures that the emails are sent correctly when a full or partial refund is made. */ private function register_refund_email_triggers() { add_action( 'woocommerce_order_fully_refunded_notification', array( $this, 'trigger_full' ), 10, 2 ); add_action( 'woocommerce_order_partially_refunded_notification', array( $this, 'trigger_partial' ), 10, 2 ); } /** * Add additional details to the order item totals table. * * @param array $total_rows Array of total rows. * @param WC_Order $order Order object. * @param string $tax_display Tax display. * @return array Modified array of total rows. */ public function order_item_totals( $total_rows, $order, $tax_display ) { $auth_code = $order->get_meta( '_charge_id', true ); if ( ! empty( $auth_code ) ) { $total_rows['payment_auth_code'] = array( 'type' => 'payment_auth_code', 'label' => __( 'Auth code:', 'woocommerce' ), 'value' => $auth_code, ); } if ( $order->get_date_paid() !== null ) { $total_rows['date_paid'] = array( 'type' => 'date_paid', 'label' => __( 'Time of payment:', 'woocommerce' ), 'value' => wc_format_datetime( $order->get_date_paid(), get_option( 'date_format' ) . ' ' . get_option( 'time_format' ) ), ); } return $total_rows; } /** * Get the store name from POS settings. * * @return string */ private function get_pos_store_name() { return $this->format_string( get_option( 'woocommerce_pos_store_name', PointOfSaleDefaultSettings::get_default_store_name() ) ); } /** * Get the store email from POS settings. * * @return string */ private function get_pos_store_email() { return $this->format_string( get_option( 'woocommerce_pos_store_email', PointOfSaleDefaultSettings::get_default_store_email() ) ); } /** * Get the store phone number from POS settings. * * @return string */ private function get_pos_store_phone_number() { return $this->format_string( get_option( 'woocommerce_pos_store_phone' ) ); } /** * Get the store address from POS settings. * * @return string */ private function get_pos_store_address() { return $this->format_string( get_option( 'woocommerce_pos_store_address', PointOfSaleDefaultSettings::get_default_store_address() ) ); } /** * Get the refund and returns policy from POS settings. * * @return string */ private function get_pos_refund_returns_policy() { return $this->format_string( get_option( 'woocommerce_pos_refund_returns_policy' ) ); } /** * Replace footer text placeholders with POS-specific values. * * @param string $footer_text The footer text to be filtered. * @param mixed $email Email object. * @return string Modified footer text. * * @internal For exclusive usage within this class, backwards compatibility not guaranteed. */ public function replace_footer_placeholders( $footer_text, $email ) { // Only replace placeholders if we're in the context of a POS email. if ( $email->id !== $this->id ) { return $footer_text; } return str_replace( array( '{site_title}', '{store_address}', '{store_email}', ), array( $this->get_pos_store_name(), $this->get_pos_store_address(), $this->get_pos_store_email(), ), $footer_text ); } } endif; return new WC_Email_Customer_POS_Refunded_Order(); class-wc-email-customer-refunded-order.php 0000777 00000026762 15252364676 0014664 0 ustar 00 <?php /** * Class WC_Email_Customer_Refunded_Order file. * * @package WooCommerce\Emails */ use Automattic\WooCommerce\Utilities\FeaturesUtil; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } if ( ! class_exists( 'WC_Email_Customer_Refunded_Order', false ) ) : /** * Customer Refunded Order Email. * * Order refunded emails are sent to the customer when the order is marked refunded. * * @class WC_Email_Customer_Refunded_Order * @version 3.5.0 * @package WooCommerce\Classes\Emails * @extends WC_Email */ class WC_Email_Customer_Refunded_Order extends WC_Email { /** * Refund order. * * @var WC_Order|bool */ public $refund; /** * Is the order partial refunded? * * @var bool */ public $partial_refund; /** * Constructor. */ public function __construct() { $this->customer_email = true; $this->id = 'customer_refunded_order'; $this->title = __( 'Refunded order', 'woocommerce' ); $this->email_group = 'order-changes'; $this->template_html = 'emails/customer-refunded-order.php'; $this->template_plain = 'emails/plain/customer-refunded-order.php'; $this->placeholders = array( '{order_date}' => '', '{order_number}' => '', ); // Triggers for this email. add_action( 'woocommerce_order_fully_refunded_notification', array( $this, 'trigger_full' ), 10, 2 ); add_action( 'woocommerce_order_partially_refunded_notification', array( $this, 'trigger_partial' ), 10, 2 ); // Call parent constructor. parent::__construct(); // Must be after parent's constructor which sets `email_improvements_enabled` property. $this->description = $this->email_improvements_enabled ? __( 'Send an email to customers notifying them when an order has been partially or fully refunded', 'woocommerce' ) : __( 'Order refunded emails are sent to customers when their orders are refunded.', 'woocommerce' ); if ( $this->block_email_editor_enabled ) { $this->title = __( 'Order refunded', 'woocommerce' ); $this->description = __( 'Notifies customers when their order has been partially or fully refunded.', 'woocommerce' ); } } /** * Get email subject. * * @param bool $partial Whether it is a partial refund or a full refund. * @since 3.1.0 * @return string */ public function get_default_subject( $partial = false ) { if ( $partial ) { return __( 'Your {site_title} order #{order_number} has been partially refunded', 'woocommerce' ); } else { return __( 'Your {site_title} order #{order_number} has been refunded', 'woocommerce' ); } } /** * Get email heading. * * @param bool $partial Whether it is a partial refund or a full refund. * @since 3.1.0 * @return string */ public function get_default_heading( $partial = false ) { if ( $partial ) { return $this->email_improvements_enabled ? __( 'Partial refund: Order {order_number}', 'woocommerce' ) : __( 'Partial Refund: Order {order_number}', 'woocommerce' ); } else { return $this->email_improvements_enabled ? __( 'Order refunded: {order_number}', 'woocommerce' ) : __( 'Order Refunded: {order_number}', 'woocommerce' ); } } /** * Get email subject. * * @return string */ public function get_subject() { if ( $this->partial_refund ) { $subject = $this->get_option( 'subject_partial', $this->get_default_subject( true ) ); } else { $subject = $this->get_option( 'subject_full', $this->get_default_subject() ); } /** * Filter the email subject for customer refunded order. * * @param string $subject The email subject. * @param WC_Order $order Order object. * @param WC_Email_Customer_Refunded_Order $email Email object. * @since 3.7.0 */ $subject = apply_filters( 'woocommerce_email_subject_customer_refunded_order', $this->format_string( $subject ), $this->object, $this ); if ( $this->block_email_editor_enabled ) { $subject = $this->personalizer->personalize_transactional_content( $subject, $this ); } return $subject; } /** * Get email heading. * * @return string */ public function get_heading() { if ( $this->partial_refund ) { $heading = $this->get_option( 'heading_partial', $this->get_default_heading( true ) ); } else { $heading = $this->get_option( 'heading_full', $this->get_default_heading() ); } /** * Filter the email heading for customer refunded order. * * @param string $heading The email heading. * @param WC_Order $order Order object. * @param WC_Email_Customer_Refunded_Order $email Email object. * @since 3.7.0 */ return apply_filters( 'woocommerce_email_heading_customer_refunded_order', $this->format_string( $heading ), $this->object, $this ); } /** * Set email strings. * * @param bool $partial_refund Whether it is a partial refund or a full refund. * @deprecated 3.1.0 Unused. */ public function set_email_strings( $partial_refund = false ) {} /** * Full refund notification. * * @param int $order_id Order ID. * @param int $refund_id Refund ID. */ public function trigger_full( $order_id, $refund_id = null ) { $this->trigger( $order_id, false, $refund_id ); } /** * Partial refund notification. * * @param int $order_id Order ID. * @param int $refund_id Refund ID. */ public function trigger_partial( $order_id, $refund_id = null ) { $this->trigger( $order_id, true, $refund_id ); } /** * Trigger. * * @param int $order_id Order ID. * @param bool $partial_refund Whether it is a partial refund or a full refund. * @param int $refund_id Refund ID. */ public function trigger( $order_id, $partial_refund = false, $refund_id = null ) { $this->setup_locale(); $this->partial_refund = $partial_refund; $this->id = $this->partial_refund ? 'customer_partially_refunded_order' : 'customer_refunded_order'; if ( $order_id ) { $this->object = wc_get_order( $order_id ); $this->recipient = $this->object->get_billing_email(); $this->placeholders['{order_date}'] = wc_format_datetime( $this->object->get_date_created() ); $this->placeholders['{order_number}'] = $this->object->get_order_number(); } if ( ! empty( $refund_id ) ) { $this->refund = wc_get_order( $refund_id ); } else { $this->refund = false; } if ( $this->is_enabled() && $this->get_recipient() ) { $this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() ); } $this->restore_locale(); } /** * Get content html. * * @return string */ public function get_content_html() { return wc_get_template_html( $this->template_html, array( 'order' => $this->object, 'refund' => $this->refund, 'partial_refund' => $this->partial_refund, 'email_heading' => $this->get_heading(), 'additional_content' => $this->get_additional_content(), 'blogname' => $this->get_blogname(), 'sent_to_admin' => false, 'plain_text' => false, 'email' => $this, ) ); } /** * Get content plain. * * @return string */ public function get_content_plain() { return wc_get_template_html( $this->template_plain, array( 'order' => $this->object, 'refund' => $this->refund, 'partial_refund' => $this->partial_refund, 'email_heading' => $this->get_heading(), 'additional_content' => $this->get_additional_content(), 'blogname' => $this->get_blogname(), 'sent_to_admin' => false, 'plain_text' => true, 'email' => $this, ) ); } /** * Get block editor email template content. * * @return string */ public function get_block_editor_email_template_content() { return wc_get_template_html( $this->template_block_content, array( 'order' => $this->object, 'refund' => $this->refund, 'partial_refund' => $this->partial_refund, 'sent_to_admin' => false, 'plain_text' => false, 'email' => $this, ) ); } /** * Default content to show below main email content. * * @since 3.7.0 * @return string */ public function get_default_additional_content() { return $this->email_improvements_enabled ? __( 'If you need any help with your order, please contact us at {store_email}.', 'woocommerce' ) : __( 'We hope to see you again soon.', 'woocommerce' ); } /** * Initialise settings form fields. */ public function init_form_fields() { /* translators: %s: list of placeholders */ $placeholder_text = sprintf( __( 'Available placeholders: %s', 'woocommerce' ), '<code>' . esc_html( implode( '</code>, <code>', array_keys( $this->placeholders ) ) ) . '</code>' ); $this->form_fields = array( 'enabled' => array( 'title' => __( 'Enable/Disable', 'woocommerce' ), 'type' => 'checkbox', 'label' => __( 'Enable this email notification', 'woocommerce' ), 'default' => 'yes', ), 'subject_full' => array( 'title' => __( 'Full refund subject', 'woocommerce' ), 'type' => 'text', 'desc_tip' => true, 'description' => $placeholder_text, 'placeholder' => $this->get_default_subject(), 'default' => '', ), 'subject_partial' => array( 'title' => __( 'Partial refund subject', 'woocommerce' ), 'type' => 'text', 'desc_tip' => true, 'description' => $placeholder_text, 'placeholder' => $this->get_default_subject( true ), 'default' => '', ), 'heading_full' => array( 'title' => __( 'Full refund email heading', 'woocommerce' ), 'type' => 'text', 'desc_tip' => true, 'description' => $placeholder_text, 'placeholder' => $this->get_default_heading(), 'default' => '', ), 'heading_partial' => array( 'title' => __( 'Partial refund email heading', 'woocommerce' ), 'type' => 'text', 'desc_tip' => true, 'description' => $placeholder_text, 'placeholder' => $this->get_default_heading( true ), 'default' => '', ), 'additional_content' => array( 'title' => __( 'Additional content', 'woocommerce' ), 'description' => __( 'Text to appear below the main email content.', 'woocommerce' ) . ' ' . $placeholder_text, 'css' => 'width:400px; height: 75px;', 'placeholder' => __( 'N/A', 'woocommerce' ), 'type' => 'textarea', 'default' => $this->get_default_additional_content(), 'desc_tip' => true, ), 'email_type' => array( 'title' => __( 'Email type', 'woocommerce' ), 'type' => 'select', 'description' => __( 'Choose which format of email to send.', 'woocommerce' ), 'default' => 'html', 'class' => 'email_type wc-enhanced-select', 'options' => $this->get_email_type_options(), 'desc_tip' => true, ), ); if ( FeaturesUtil::feature_is_enabled( 'email_improvements' ) ) { $this->form_fields['cc'] = $this->get_cc_field(); $this->form_fields['bcc'] = $this->get_bcc_field(); } if ( $this->block_email_editor_enabled ) { $this->form_fields['preheader'] = $this->get_preheader_field(); } } } endif; return new WC_Email_Customer_Refunded_Order(); class-wc-email-customer-invoice.php 0000777 00000021457 15252364676 0013407 0 ustar 00 <?php /** * Class WC_Email_Customer_Invoice file. * * @package WooCommerce\Emails */ use Automattic\WooCommerce\Enums\OrderStatus; use Automattic\WooCommerce\Utilities\FeaturesUtil; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } if ( ! class_exists( 'WC_Email_Customer_Invoice', false ) ) : /** * Order details email. * * An email sent to the customer via admin, that summarizes the details of their order. This was * historically referred to as the 'invoice', and for backwards compatibility reasons that is still * reflected in the class name (although on a user-level we have moved away from that nomenclature). * * @class WC_Email_Customer_Invoice * @version 3.5.0 * @package WooCommerce\Classes\Emails * @extends WC_Email */ class WC_Email_Customer_Invoice extends WC_Email { /** * Constructor. */ public function __construct() { $this->id = 'customer_invoice'; $this->customer_email = true; $this->title = __( 'Order details', 'woocommerce' ); $this->email_group = 'payments'; $this->template_html = 'emails/customer-invoice.php'; $this->template_plain = 'emails/plain/customer-invoice.php'; $this->placeholders = array( '{order_date}' => '', '{order_number}' => '', ); // Call parent constructor. parent::__construct(); // Must be after parent's constructor which sets `email_improvements_enabled` property. $this->description = $this->email_improvements_enabled ? __( 'Manually send an email to your customers containing their order information and payment links', 'woocommerce' ) : __( 'Order detail emails can be sent to customers containing their order information and payment links.', 'woocommerce' ); $this->manual = true; if ( $this->block_email_editor_enabled ) { $this->title = __( 'Payment request', 'woocommerce' ); $this->description = __( 'Manually send customers an email to review their order and complete payment.', 'woocommerce' ); } } /** * Get email subject. * * @param bool $paid Whether the order has been paid or not. * @since 3.1.0 * @return string */ public function get_default_subject( $paid = false ) { return __( 'Details for order #{order_number} on {site_title}', 'woocommerce' ); } /** * Get email heading. * * @param bool $paid Whether the order has been paid or not. * @since 3.1.0 * @return string */ public function get_default_heading( $paid = false ) { return __( 'Details for order #{order_number}', 'woocommerce' ); } /** * Get email subject. * * @return string */ public function get_subject() { if ( $this->object->has_status( array( OrderStatus::COMPLETED, OrderStatus::PROCESSING ) ) ) { $subject = $this->get_option( 'subject_paid', $this->get_default_subject( true ) ); if ( $this->block_email_editor_enabled ) { $subject = $this->personalizer->personalize_transactional_content( $subject, $this ); } return apply_filters( 'woocommerce_email_subject_customer_invoice_paid', $this->format_string( $subject ), $this->object, $this ); } $subject = $this->get_option( 'subject', $this->get_default_subject() ); if ( $this->block_email_editor_enabled ) { $subject = $this->personalizer->personalize_transactional_content( $subject, $this ); } return apply_filters( 'woocommerce_email_subject_customer_invoice', $this->format_string( $subject ), $this->object, $this ); } /** * Get email heading. * * @return string */ public function get_heading() { if ( $this->object->has_status( wc_get_is_paid_statuses() ) ) { $heading = $this->get_option( 'heading_paid', $this->get_default_heading( true ) ); return apply_filters( 'woocommerce_email_heading_customer_invoice_paid', $this->format_string( $heading ), $this->object, $this ); } $heading = $this->get_option( 'heading', $this->get_default_heading() ); return apply_filters( 'woocommerce_email_heading_customer_invoice', $this->format_string( $heading ), $this->object, $this ); } /** * Default content to show below main email content. * * @since 3.7.0 * @return string */ public function get_default_additional_content() { return $this->email_improvements_enabled ? __( 'Thanks again! If you need any help with your order, please contact us at {store_email}.', 'woocommerce' ) : __( 'Thanks for using {site_url}!', 'woocommerce' ); } /** * Trigger the sending of this email. * * @param int $order_id The order ID. * @param WC_Order $order Order object. */ public function trigger( $order_id, $order = false ) { $this->setup_locale(); if ( $order_id && ! is_a( $order, 'WC_Order' ) ) { $order = wc_get_order( $order_id ); } if ( is_a( $order, 'WC_Order' ) ) { $this->object = $order; $this->recipient = $this->object->get_billing_email(); $this->placeholders['{order_date}'] = wc_format_datetime( $this->object->get_date_created() ); $this->placeholders['{order_number}'] = $this->object->get_order_number(); } if ( $this->get_recipient() ) { $this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() ); } $this->restore_locale(); } /** * Get content html. * * @return string */ public function get_content_html() { return wc_get_template_html( $this->template_html, array( 'order' => $this->object, 'email_heading' => $this->get_heading(), 'additional_content' => $this->get_additional_content(), 'sent_to_admin' => false, 'plain_text' => false, 'email' => $this, ) ); } /** * Get content plain. * * @return string */ public function get_content_plain() { return wc_get_template_html( $this->template_plain, array( 'order' => $this->object, 'email_heading' => $this->get_heading(), 'additional_content' => $this->get_additional_content(), 'sent_to_admin' => false, 'plain_text' => true, 'email' => $this, ) ); } /** * Initialise settings form fields. */ public function init_form_fields() { /* translators: %s: list of placeholders */ $placeholder_text = sprintf( __( 'Available placeholders: %s', 'woocommerce' ), '<code>' . esc_html( implode( '</code>, <code>', array_keys( $this->placeholders ) ) ) . '</code>' ); $this->form_fields = array( 'subject' => array( 'title' => __( 'Subject', 'woocommerce' ), 'type' => 'text', 'desc_tip' => true, 'description' => $placeholder_text, 'placeholder' => $this->get_default_subject(), 'default' => '', ), 'heading' => array( 'title' => __( 'Email heading', 'woocommerce' ), 'type' => 'text', 'desc_tip' => true, 'description' => $placeholder_text, 'placeholder' => $this->get_default_heading(), 'default' => '', ), 'subject_paid' => array( 'title' => __( 'Subject (paid)', 'woocommerce' ), 'type' => 'text', 'desc_tip' => true, 'description' => $placeholder_text, 'placeholder' => $this->get_default_subject( true ), 'default' => '', ), 'heading_paid' => array( 'title' => __( 'Email heading (paid)', 'woocommerce' ), 'type' => 'text', 'desc_tip' => true, 'description' => $placeholder_text, 'placeholder' => $this->get_default_heading( true ), 'default' => '', ), 'additional_content' => array( 'title' => __( 'Additional content', 'woocommerce' ), 'description' => __( 'Text to appear below the main email content.', 'woocommerce' ) . ' ' . $placeholder_text, 'css' => 'width:400px; height: 75px;', 'placeholder' => __( 'N/A', 'woocommerce' ), 'type' => 'textarea', 'default' => $this->get_default_additional_content(), 'desc_tip' => true, ), 'email_type' => array( 'title' => __( 'Email type', 'woocommerce' ), 'type' => 'select', 'description' => __( 'Choose which format of email to send.', 'woocommerce' ), 'default' => 'html', 'class' => 'email_type wc-enhanced-select', 'options' => $this->get_email_type_options(), 'desc_tip' => true, ), ); if ( FeaturesUtil::feature_is_enabled( 'email_improvements' ) ) { $this->form_fields['cc'] = $this->get_cc_field(); $this->form_fields['bcc'] = $this->get_bcc_field(); } if ( $this->block_email_editor_enabled ) { $this->form_fields['preheader'] = $this->get_preheader_field(); } } } endif; return new WC_Email_Customer_Invoice(); class-wc-email-customer-failed-order.php 0000777 00000010707 15252364676 0014304 0 ustar 00 <?php /** * Class WC_Email_Customer_Failed_Order file. * * @package WooCommerce\Emails */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } if ( ! class_exists( 'WC_Email_Customer_Failed_Order', false ) ) : /** * Customer failed Order Email. * * Order failed emails are sent to the customer when their order are marked as failed. * * @class WC_Email_Customer_Failed_Order * @version 2.0.0 * @package WooCommerce\Classes\Emails * @extends WC_Email */ class WC_Email_Customer_Failed_Order extends WC_Email { /** * Constructor. */ public function __construct() { $this->id = 'customer_failed_order'; $this->customer_email = true; $this->title = __( 'Failed order', 'woocommerce' ); $this->email_group = 'order-changes'; $this->template_html = 'emails/customer-failed-order.php'; $this->template_plain = 'emails/plain/customer-failed-order.php'; $this->placeholders = array( '{order_date}' => '', '{order_number}' => '', ); // Triggers for this email. add_action( 'woocommerce_order_status_failed_notification', array( $this, 'trigger' ), 10, 2 ); // Call parent constructor. parent::__construct(); // Must be after parent's constructor which sets `email_improvements_enabled` property. $this->description = $this->email_improvements_enabled ? __( 'Receive an email notification when an order that was processing or on hold fails', 'woocommerce' ) : __( 'Order failed emails are sent to customers when their orders are marked as failed.', 'woocommerce' ); if ( $this->block_email_editor_enabled ) { $this->title = __( 'Order failed', 'woocommerce' ); $this->description = __( 'Notifies customers when their order has failed.', 'woocommerce' ); } } /** * Trigger the sending of this email. * * @param int $order_id The order ID. * @param WC_Order|false $order Order object. */ public function trigger( $order_id, $order = false ) { $this->setup_locale(); if ( $order_id && ! is_a( $order, 'WC_Order' ) ) { $order = wc_get_order( $order_id ); } if ( is_a( $order, 'WC_Order' ) ) { $this->object = $order; $this->recipient = $this->object->get_billing_email(); $this->placeholders['{order_date}'] = wc_format_datetime( $this->object->get_date_created() ); $this->placeholders['{order_number}'] = $this->object->get_order_number(); } if ( $this->is_enabled() && $this->get_recipient() ) { $this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() ); } $this->restore_locale(); } /** * Get email subject. * * @since 3.1.0 * @return string */ public function get_default_subject() { return __( 'Your order at {site_title} was unsuccessful', 'woocommerce' ); } /** * Get email heading. * * @since 3.1.0 * @return string */ public function get_default_heading() { return __( 'Sorry, your order was unsuccessful', 'woocommerce' ); } /** * Get content html. * * @return string */ public function get_content_html() { return wc_get_template_html( $this->template_html, array( 'order' => $this->object, 'email_heading' => $this->get_heading(), 'additional_content' => $this->get_additional_content(), 'blogname' => $this->get_blogname(), 'sent_to_admin' => false, 'plain_text' => false, 'email' => $this, ) ); } /** * Get content plain. * * @return string */ public function get_content_plain() { return wc_get_template_html( $this->template_plain, array( 'order' => $this->object, 'email_heading' => $this->get_heading(), 'additional_content' => $this->get_additional_content(), 'blogname' => $this->get_blogname(), 'sent_to_admin' => false, 'plain_text' => true, 'email' => $this, ) ); } /** * Default content to show below main email content. * * @since 3.7.0 * @return string */ public function get_default_additional_content() { return $this->email_improvements_enabled ? __( 'If you need any help with your order, please contact us at {store_email}.', 'woocommerce' ) : ''; } } endif; return new WC_Email_Customer_Failed_Order(); class-wc-email-customer-processing-order.php 0000777 00000011462 15252364676 0015233 0 ustar 00 <?php /** * Class WC_Email_Customer_Processing_Order file. * * @package WooCommerce\Emails */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } if ( ! class_exists( 'WC_Email_Customer_Processing_Order', false ) ) : /** * Customer Processing Order Email. * * An email sent to the customer when a new order is paid for. * * @class WC_Email_Customer_Processing_Order * @version 3.5.0 * @package WooCommerce\Classes\Emails * @extends WC_Email */ class WC_Email_Customer_Processing_Order extends WC_Email { /** * Constructor. */ public function __construct() { $this->id = 'customer_processing_order'; $this->customer_email = true; $this->title = __( 'Processing order', 'woocommerce' ); $this->email_group = 'order-updates'; $this->template_html = 'emails/customer-processing-order.php'; $this->template_plain = 'emails/plain/customer-processing-order.php'; $this->placeholders = array( '{order_date}' => '', '{order_number}' => '', ); // Triggers for this email. add_action( 'woocommerce_order_status_cancelled_to_processing_notification', array( $this, 'trigger' ), 10, 2 ); add_action( 'woocommerce_order_status_failed_to_processing_notification', array( $this, 'trigger' ), 10, 2 ); add_action( 'woocommerce_order_status_on-hold_to_processing_notification', array( $this, 'trigger' ), 10, 2 ); add_action( 'woocommerce_order_status_pending_to_processing_notification', array( $this, 'trigger' ), 10, 2 ); // Call parent constructor. parent::__construct(); // Must be after parent's constructor which sets `email_improvements_enabled` property. $this->description = $this->email_improvements_enabled ? __( 'Send an email to customers notifying them that their order is being processed', 'woocommerce' ) : __( 'This is an order notification sent to customers containing order details after payment.', 'woocommerce' ); if ( $this->block_email_editor_enabled ) { $this->title = __( 'Order confirmation', 'woocommerce' ); $this->description = __( 'Notifies customers when their order has been received and is being processed.', 'woocommerce' ); } } /** * Get email subject. * * @since 3.1.0 * @return string */ public function get_default_subject() { return __( 'Your {site_title} order has been received!', 'woocommerce' ); } /** * Get email heading. * * @since 3.1.0 * @return string */ public function get_default_heading() { return __( 'Thank you for your order', 'woocommerce' ); } /** * Trigger the sending of this email. * * @param int $order_id The order ID. * @param WC_Order|false $order Order object. */ public function trigger( $order_id, $order = false ) { $this->setup_locale(); if ( $order_id && ! is_a( $order, 'WC_Order' ) ) { $order = wc_get_order( $order_id ); } if ( is_a( $order, 'WC_Order' ) ) { $this->object = $order; $this->recipient = $this->object->get_billing_email(); $this->placeholders['{order_date}'] = wc_format_datetime( $this->object->get_date_created() ); $this->placeholders['{order_number}'] = $this->object->get_order_number(); } if ( $this->is_enabled() && $this->get_recipient() ) { $this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() ); } $this->restore_locale(); } /** * Get content html. * * @return string */ public function get_content_html() { return wc_get_template_html( $this->template_html, array( 'order' => $this->object, 'email_heading' => $this->get_heading(), 'additional_content' => $this->get_additional_content(), 'sent_to_admin' => false, 'plain_text' => false, 'email' => $this, ) ); } /** * Get content plain. * * @return string */ public function get_content_plain() { return wc_get_template_html( $this->template_plain, array( 'order' => $this->object, 'email_heading' => $this->get_heading(), 'additional_content' => $this->get_additional_content(), 'sent_to_admin' => false, 'plain_text' => true, 'email' => $this, ) ); } /** * Default content to show below main email content. * * @since 3.7.0 * @return string */ public function get_default_additional_content() { return $this->email_improvements_enabled ? __( 'Thanks again! If you need any help with your order, please contact us at {store_email}.', 'woocommerce' ) : __( 'Thanks for using {site_url}!', 'woocommerce' ); } } endif; return new WC_Email_Customer_Processing_Order(); class-wc-email-cancelled-order.php 0000777 00000017362 15252364676 0013137 0 ustar 00 <?php /** * Class WC_Email_Cancelled_Order file. * * @package WooCommerce\Emails */ use Automattic\WooCommerce\Utilities\FeaturesUtil; if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'WC_Email_Cancelled_Order', false ) ) : /** * Cancelled Order Email. * * An email sent to the admin when an order is cancelled. * * @class WC_Email_Cancelled_Order * @version 2.2.7 * @package WooCommerce\Classes\Emails * @extends WC_Email */ class WC_Email_Cancelled_Order extends WC_Email { /** * Constructor. */ public function __construct() { $this->id = 'cancelled_order'; $this->title = __( 'Cancelled order', 'woocommerce' ); $this->email_group = 'orders'; $this->template_html = 'emails/admin-cancelled-order.php'; $this->template_plain = 'emails/plain/admin-cancelled-order.php'; $this->placeholders = array( '{order_date}' => '', '{order_number}' => '', '{order_billing_full_name}' => '', ); // Triggers for this email. add_action( 'woocommerce_order_status_processing_to_cancelled_notification', array( $this, 'trigger' ), 10, 2 ); add_action( 'woocommerce_order_status_on-hold_to_cancelled_notification', array( $this, 'trigger' ), 10, 2 ); // Call parent constructor. parent::__construct(); // Must be after parent's constructor which sets `email_improvements_enabled` property. $this->description = $this->email_improvements_enabled ? __( 'Receive an email notification when an order that was processing or on hold gets cancelled', 'woocommerce' ) : __( 'Cancelled order emails are sent to chosen recipient(s) when orders have been marked cancelled (if they were previously processing or on-hold).', 'woocommerce' ); if ( $this->block_email_editor_enabled ) { $this->title = __( 'Canceled order', 'woocommerce' ); $this->description = __( 'Notifies admins when an order that was processing or on hold has been canceled.', 'woocommerce' ); } // Other settings. $this->recipient = $this->get_option( 'recipient', get_option( 'admin_email' ) ); } /** * Get email subject. * * @since 3.1.0 * @return string */ public function get_default_subject() { return __( '[{site_title}]: Order #{order_number} has been cancelled', 'woocommerce' ); } /** * Get email heading. * * @since 3.1.0 * @return string */ public function get_default_heading() { return $this->email_improvements_enabled ? __( 'Order cancelled: #{order_number}', 'woocommerce' ) : __( 'Order Cancelled: #{order_number}', 'woocommerce' ); } /** * Trigger the sending of this email. * * @param int $order_id The order ID. * @param WC_Order|false $order Order object. */ public function trigger( $order_id, $order = false ) { $this->setup_locale(); if ( $order_id && ! is_a( $order, 'WC_Order' ) ) { $order = wc_get_order( $order_id ); } if ( is_a( $order, 'WC_Order' ) ) { $this->object = $order; $this->placeholders['{order_date}'] = wc_format_datetime( $this->object->get_date_created() ); $this->placeholders['{order_number}'] = $this->object->get_order_number(); $this->placeholders['{order_billing_full_name}'] = $this->object->get_formatted_billing_full_name(); } if ( $this->is_enabled() && $this->get_recipient() ) { $this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() ); } $this->restore_locale(); } /** * Get content html. * * @return string */ public function get_content_html() { return wc_get_template_html( $this->template_html, array( 'order' => $this->object, 'email_heading' => $this->get_heading(), 'additional_content' => $this->get_additional_content(), 'sent_to_admin' => true, 'plain_text' => false, 'email' => $this, ) ); } /** * Get content plain. * * @return string */ public function get_content_plain() { return wc_get_template_html( $this->template_plain, array( 'order' => $this->object, 'email_heading' => $this->get_heading(), 'additional_content' => $this->get_additional_content(), 'sent_to_admin' => true, 'plain_text' => true, 'email' => $this, ) ); } /** * Get block editor email template content. * * @return string */ public function get_block_editor_email_template_content() { return wc_get_template_html( $this->template_block_content, array( 'order' => $this->object, 'sent_to_admin' => true, 'plain_text' => false, 'email' => $this, ) ); } /** * Default content to show below main email content. * * @since 3.7.0 * @return string */ public function get_default_additional_content() { return __( 'Thanks for reading.', 'woocommerce' ); } /** * Initialise settings form fields. */ public function init_form_fields() { /* translators: %s: list of placeholders */ $placeholder_text = sprintf( __( 'Available placeholders: %s', 'woocommerce' ), '<code>' . esc_html( implode( '</code>, <code>', array_keys( $this->placeholders ) ) ) . '</code>' ); $this->form_fields = array( 'enabled' => array( 'title' => __( 'Enable/Disable', 'woocommerce' ), 'type' => 'checkbox', 'label' => __( 'Enable this email notification', 'woocommerce' ), 'default' => 'yes', ), 'recipient' => array( 'title' => __( 'Recipient(s)', 'woocommerce' ), 'type' => 'text', /* translators: %s: admin email */ 'description' => sprintf( __( 'Enter recipients (comma separated) for this email. Defaults to %s.', 'woocommerce' ), '<code>' . esc_attr( get_option( 'admin_email' ) ) . '</code>' ), 'placeholder' => '', 'default' => '', 'desc_tip' => true, ), 'subject' => array( 'title' => __( 'Subject', 'woocommerce' ), 'type' => 'text', 'desc_tip' => true, 'description' => $placeholder_text, 'placeholder' => $this->get_default_subject(), 'default' => '', ), 'heading' => array( 'title' => __( 'Email heading', 'woocommerce' ), 'type' => 'text', 'desc_tip' => true, 'description' => $placeholder_text, 'placeholder' => $this->get_default_heading(), 'default' => '', ), 'additional_content' => array( 'title' => __( 'Additional content', 'woocommerce' ), 'description' => __( 'Text to appear below the main email content.', 'woocommerce' ) . ' ' . $placeholder_text, 'css' => 'width:400px; height: 75px;', 'placeholder' => __( 'N/A', 'woocommerce' ), 'type' => 'textarea', 'default' => $this->get_default_additional_content(), 'desc_tip' => true, ), 'email_type' => array( 'title' => __( 'Email type', 'woocommerce' ), 'type' => 'select', 'description' => __( 'Choose which format of email to send.', 'woocommerce' ), 'default' => 'html', 'class' => 'email_type wc-enhanced-select', 'options' => $this->get_email_type_options(), 'desc_tip' => true, ), ); if ( FeaturesUtil::feature_is_enabled( 'email_improvements' ) ) { $this->form_fields['cc'] = $this->get_cc_field(); $this->form_fields['bcc'] = $this->get_bcc_field(); } if ( $this->block_email_editor_enabled ) { $this->form_fields['preheader'] = $this->get_preheader_field(); } } } endif; return new WC_Email_Cancelled_Order(); class-wc-email-customer-reset-password.php 0000777 00000012041 15252364676 0014722 0 ustar 00 <?php /** * Class WC_Email_Customer_Reset_Password file. * * @package WooCommerce\Emails */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } if ( ! class_exists( 'WC_Email_Customer_Reset_Password', false ) ) : /** * Customer Reset Password. * * An email sent to the customer when they reset their password. * * @class WC_Email_Customer_Reset_Password * @version 3.5.0 * @package WooCommerce\Classes\Emails * @extends WC_Email */ class WC_Email_Customer_Reset_Password extends WC_Email { /** * User ID. * * @var integer */ public $user_id; /** * User login name. * * @var string */ public $user_login; /** * User email. * * @var string */ public $user_email; /** * Reset key. * * @var string */ public $reset_key; /** * Constructor. */ public function __construct() { $this->id = 'customer_reset_password'; $this->customer_email = true; $this->title = __( 'Reset password', 'woocommerce' ); $this->description = __( 'Send an email to customers notifying them that their password has been reset', 'woocommerce' ); $this->template_html = 'emails/customer-reset-password.php'; $this->template_plain = 'emails/plain/customer-reset-password.php'; $this->email_group = 'accounts'; // Trigger. add_action( 'woocommerce_reset_password_notification', array( $this, 'trigger' ), 10, 2 ); // Call parent constructor. parent::__construct(); // Must be after parent's constructor which sets `block_email_editor_enabled` property. if ( $this->block_email_editor_enabled ) { $this->title = __( 'Account password reset', 'woocommerce' ); $this->description = __( 'Notifies customers when their password has been reset.', 'woocommerce' ); } } /** * Get email subject. * * @since 3.1.0 * @return string */ public function get_default_subject() { return $this->email_improvements_enabled ? __( 'Reset your password for {site_title}', 'woocommerce' ) : __( 'Password Reset Request for {site_title}', 'woocommerce' ); } /** * Get email heading. * * @since 3.1.0 * @return string */ public function get_default_heading() { return $this->email_improvements_enabled ? __( 'Reset your password', 'woocommerce' ) : __( 'Password Reset Request', 'woocommerce' ); } /** * Trigger. * * @param string $user_login User login. * @param string $reset_key Password reset key. */ public function trigger( $user_login = '', $reset_key = '' ) { $this->setup_locale(); if ( $user_login && $reset_key ) { $this->object = get_user_by( 'login', $user_login ); $this->user_id = $this->object->ID; $this->user_login = $user_login; $this->reset_key = $reset_key; $this->user_email = stripslashes( $this->object->user_email ); $this->recipient = $this->user_email; } if ( $this->is_enabled() && $this->get_recipient() ) { $this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() ); } $this->restore_locale(); } /** * Get content html. * * @return string */ public function get_content_html() { return wc_get_template_html( $this->template_html, array( 'email_heading' => $this->get_heading(), 'user_id' => $this->user_id, 'user_login' => $this->user_login, 'reset_key' => $this->reset_key, 'blogname' => $this->get_blogname(), 'additional_content' => $this->get_additional_content(), 'sent_to_admin' => false, 'plain_text' => false, 'email' => $this, ) ); } /** * Get content plain. * * @return string */ public function get_content_plain() { return wc_get_template_html( $this->template_plain, array( 'email_heading' => $this->get_heading(), 'user_id' => $this->user_id, 'user_login' => $this->user_login, 'reset_key' => $this->reset_key, 'blogname' => $this->get_blogname(), 'additional_content' => $this->get_additional_content(), 'sent_to_admin' => false, 'plain_text' => true, 'email' => $this, ) ); } /** * Get block editor email template content. * * @return string */ public function get_block_editor_email_template_content() { return wc_get_template_html( $this->template_block_content, array( 'user_id' => $this->user_id, 'user_login' => $this->user_login, 'reset_key' => $this->reset_key, 'sent_to_admin' => false, 'plain_text' => false, 'email' => $this, ) ); } /** * Default content to show below main email content. * * @since 3.7.0 * @return string */ public function get_default_additional_content() { return __( 'Thanks for reading.', 'woocommerce' ); } } endif; return new WC_Email_Customer_Reset_Password(); class-wc-email-customer-cancelled-order.php 0000777 00000016612 15252364676 0014773 0 ustar 00 <?php /** * Class WC_Email_Customer_Cancelled_Order file. * * @package WooCommerce\Emails */ use Automattic\WooCommerce\Utilities\FeaturesUtil; if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'WC_Email_Customer_Cancelled_Order', false ) ) : /** * Cancelled Order Email for Customers. * * An email sent to the customer when an order is cancelled. * * @class WC_Email_Customer_Cancelled_Order * @version 1.0.0 * @package WooCommerce\Classes\Emails * @extends WC_Email */ class WC_Email_Customer_Cancelled_Order extends WC_Email { /** * Constructor. */ public function __construct() { $this->id = 'customer_cancelled_order'; $this->customer_email = true; $this->title = __( 'Cancelled order', 'woocommerce' ); $this->email_group = 'order-changes'; $this->template_html = 'emails/customer-cancelled-order.php'; $this->template_plain = 'emails/plain/customer-cancelled-order.php'; $this->placeholders = array( '{order_date}' => '', '{order_number}' => '', '{order_billing_full_name}' => '', ); // Triggers for this email. add_action( 'woocommerce_order_status_processing_to_cancelled_notification', array( $this, 'trigger' ), 10, 2 ); add_action( 'woocommerce_order_status_on-hold_to_cancelled_notification', array( $this, 'trigger' ), 10, 2 ); // Call parent constructor. parent::__construct(); // Must be after parent's constructor which sets `email_improvements_enabled` property. $this->description = $this->email_improvements_enabled ? __( 'Send an email to customers notifying them when their order has been cancelled', 'woocommerce' ) : __( 'Cancelled order emails are sent to customers when their orders have been marked cancelled (if they were previously processing or on-hold).', 'woocommerce' ); if ( $this->block_email_editor_enabled ) { $this->title = __( 'Order cancelled', 'woocommerce' ); $this->description = __( 'Notifies customers when their order has been cancelled.', 'woocommerce' ); } } /** * Get email subject. * * @since 1.0.0 * @return string */ public function get_default_subject() { return __( '[{site_title}]: Your order #{order_number} has been cancelled', 'woocommerce' ); } /** * Get email heading. * * @since 1.0.0 * @return string */ public function get_default_heading() { return $this->email_improvements_enabled ? __( 'Order cancelled: #{order_number}', 'woocommerce' ) : __( 'Order Cancelled: #{order_number}', 'woocommerce' ); } /** * Trigger the sending of this email. * * @param int $order_id The order ID. * @param WC_Order|false $order Order object. */ public function trigger( $order_id, $order = false ) { $this->setup_locale(); if ( $order_id && ! is_a( $order, 'WC_Order' ) ) { $order = wc_get_order( $order_id ); } if ( is_a( $order, 'WC_Order' ) ) { $this->object = $order; $this->recipient = $this->object->get_billing_email(); $this->placeholders['{order_date}'] = wc_format_datetime( $this->object->get_date_created() ); $this->placeholders['{order_number}'] = $this->object->get_order_number(); $this->placeholders['{order_billing_full_name}'] = $this->object->get_formatted_billing_full_name(); } if ( $this->is_enabled() && $this->get_recipient() ) { $this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() ); } $this->restore_locale(); } /** * Get content html. * * @return string */ public function get_content_html() { return wc_get_template_html( $this->template_html, array( 'order' => $this->object, 'email_heading' => $this->get_heading(), 'additional_content' => $this->get_additional_content(), 'sent_to_admin' => false, 'plain_text' => false, 'email' => $this, ) ); } /** * Get content plain. * * @return string */ public function get_content_plain() { return wc_get_template_html( $this->template_plain, array( 'order' => $this->object, 'email_heading' => $this->get_heading(), 'additional_content' => $this->get_additional_content(), 'sent_to_admin' => false, 'plain_text' => true, 'email' => $this, ) ); } /** * Get block editor email template content. * * @return string */ public function get_block_editor_email_template_content() { return wc_get_template_html( $this->template_block_content, array( 'order' => $this->object, 'sent_to_admin' => false, 'plain_text' => false, 'email' => $this, ) ); } /** * Default content to show below main email content. * * @since 1.0.0 * @return string */ public function get_default_additional_content() { return __( 'We hope to see you again soon.', 'woocommerce' ); } /** * Initialise settings form fields. */ public function init_form_fields() { /* translators: %s: list of placeholders */ $placeholder_text = sprintf( __( 'Available placeholders: %s', 'woocommerce' ), '<code>' . esc_html( implode( '</code>, <code>', array_keys( $this->placeholders ) ) ) . '</code>' ); $this->form_fields = array( 'enabled' => array( 'title' => __( 'Enable/Disable', 'woocommerce' ), 'type' => 'checkbox', 'label' => __( 'Enable this email notification', 'woocommerce' ), 'default' => 'no', ), 'subject' => array( 'title' => __( 'Subject', 'woocommerce' ), 'type' => 'text', 'desc_tip' => true, 'description' => $placeholder_text, 'placeholder' => $this->get_default_subject(), 'default' => '', ), 'heading' => array( 'title' => __( 'Email heading', 'woocommerce' ), 'type' => 'text', 'desc_tip' => true, 'description' => $placeholder_text, 'placeholder' => $this->get_default_heading(), 'default' => '', ), 'additional_content' => array( 'title' => __( 'Additional content', 'woocommerce' ), 'description' => __( 'Text to appear below the main email content.', 'woocommerce' ) . ' ' . $placeholder_text, 'css' => 'width:400px; height: 75px;', 'placeholder' => __( 'N/A', 'woocommerce' ), 'type' => 'textarea', 'default' => $this->get_default_additional_content(), 'desc_tip' => true, ), 'email_type' => array( 'title' => __( 'Email type', 'woocommerce' ), 'type' => 'select', 'description' => __( 'Choose which format of email to send.', 'woocommerce' ), 'default' => 'html', 'class' => 'email_type wc-enhanced-select', 'options' => $this->get_email_type_options(), 'desc_tip' => true, ), ); if ( FeaturesUtil::feature_is_enabled( 'email_improvements' ) ) { $this->form_fields['cc'] = $this->get_cc_field(); $this->form_fields['bcc'] = $this->get_bcc_field(); } if ( $this->block_email_editor_enabled ) { $this->form_fields['preheader'] = $this->get_preheader_field(); } } } endif; return new WC_Email_Customer_Cancelled_Order(); class-wc-email-customer-fulfillment-updated.php 0000777 00000015502 15252364676 0015712 0 ustar 00 <?php /** * Class WC_Email_Customer_Fulfillment_Updated file. * * @package WooCommerce\Emails */ use Automattic\WooCommerce\Internal\Fulfillments\Fulfillment; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } if ( ! class_exists( 'WC_Email_Customer_Fulfillment_Updated', false ) ) : /** * Customer Fulfillment Updated Email. * * Fulfillment updated emails are sent to the customer when the merchant updates a fulfillment for the order. The notification isn’t sent for draft fulfillments. * * @class WC_Email_Customer_Fulfillment_Updated * @version 1.0.0 * @package WooCommerce\Classes\Emails * @extends WC_Email */ class WC_Email_Customer_Fulfillment_Updated extends WC_Email { /** * Fulfillment object. * * @var Fulfillment|null */ private $fulfillment; /** * Constructor. */ public function __construct() { $this->id = 'customer_fulfillment_updated'; $this->customer_email = true; $this->title = __( 'Fulfillment updated', 'woocommerce' ); $this->email_group = 'order-updates'; $this->template_html = 'emails/customer-fulfillment-updated.php'; $this->template_plain = 'emails/plain/customer-fulfillment-updated.php'; $this->placeholders = array( '{order_date}' => '', '{order_number}' => '', ); // Triggers for this email. add_action( 'woocommerce_fulfillment_updated_notification', array( $this, 'trigger' ), 10, 3 ); // Call parent constructor. parent::__construct(); $this->description = __( 'Fulfillment updated emails are sent to the customer when the merchant updates a fulfillment for the order. The notification isn’t sent for draft fulfillments.', 'woocommerce' ); $this->template_block_content = 'emails/block/general-block-content-for-fulfillment-emails.php'; } /** * Trigger the sending of this email. * * @param int $order_id The order ID. * @param Fulfillment $fulfillment The fulfillment. * @param WC_Order|false $order Order object. */ public function trigger( $order_id, $fulfillment, $order = false ) { $this->setup_locale(); if ( $order_id && ! is_a( $order, 'WC_Order' ) ) { $order = wc_get_order( $order_id ); } if ( is_a( $order, 'WC_Order' ) ) { $this->object = $order; $this->fulfillment = $fulfillment; $this->recipient = $this->object->get_billing_email(); $this->placeholders['{order_date}'] = wc_format_datetime( $this->object->get_date_created() ); $this->placeholders['{order_number}'] = $this->object->get_order_number(); } if ( $this->is_enabled() && $this->get_recipient() ) { $this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() ); } $this->restore_locale(); } /** * Get email subject. * * @since 3.1.0 * @return string */ public function get_default_subject() { return __( 'A shipment from {site_title} order {order_number} has been updated', 'woocommerce' ); } /** * Get email heading. * * @since 3.1.0 * @return string */ public function get_default_heading() { return __( 'Your shipment has been updated', 'woocommerce' ); } /** * Get content html. * * @return string */ public function get_content_html() { $this->maybe_init_fulfillment_for_preview( $this->object ); return wc_get_template_html( $this->template_html, array( 'order' => $this->object, 'fulfillment' => $this->fulfillment, 'email_heading' => $this->get_heading(), 'additional_content' => $this->get_additional_content(), 'sent_to_admin' => false, 'plain_text' => false, 'email' => $this, ) ); } /** * Get content plain. * * @return string */ public function get_content_plain() { $this->maybe_init_fulfillment_for_preview( $this->object ); return wc_get_template_html( $this->template_plain, array( 'order' => $this->object, 'fulfillment' => $this->fulfillment, 'email_heading' => $this->get_heading(), 'additional_content' => $this->get_additional_content(), 'sent_to_admin' => false, 'plain_text' => true, 'email' => $this, ) ); } /** * Get block editor email template content. * * @return string */ public function get_block_editor_email_template_content() { $this->maybe_init_fulfillment_for_preview( $this->object ); return wc_get_template_html( $this->template_block_content, array( 'order' => $this->object, 'fulfillment' => $this->fulfillment, 'sent_to_admin' => false, 'plain_text' => false, 'email' => $this, ) ); } /** * Default content to show below main email content. * * @since 3.7.0 * @return string */ public function get_default_additional_content() { return __( 'If anything looks off or you have questions, feel free to contact our support team.', 'woocommerce' ); } /** * Initialize fulfillment for email preview. * * This method sets up a dummy fulfillment object when the email is being previewed in the admin. * * @param WC_Order $order The order object. * * @since 10.1.0 */ private function maybe_init_fulfillment_for_preview( $order ) { /** * Filter to determine if this is an email preview. * * @since 9.8.0 */ $is_email_preview = apply_filters( 'woocommerce_is_email_preview', false ); if ( $is_email_preview ) { // If this is a preview, we need to set up a dummy fulfillment object. $this->fulfillment = new Fulfillment(); $this->fulfillment->set_items( array_map( function ( $item ) { return array( 'item_id' => $item->get_id(), 'qty' => 1, ); }, $order->get_items() ) ); // Some private meta data to simulate a real fulfillment. $this->fulfillment->add_meta_data( '_tracking_number', '123456789' ); $this->fulfillment->add_meta_data( '_shipment_provider', 'dhl' ); $this->fulfillment->add_meta_data( '_tracking_url', 'https://www.dhl.com/tracking/123456789' ); // Some public data to simulate a real fulfillment. $this->fulfillment->add_meta_data( 'service', 'Standard Shipping' ); $this->fulfillment->add_meta_data( 'expected_delivery', '2025-06-30' ); // Add translations for metadata keys. add_filter( 'woocommerce_fulfillment_meta_key_translations', function ( $keys ) { $keys['service'] = __( 'Service', 'woocommerce' ); $keys['expected_delivery'] = __( 'Expected Delivery', 'woocommerce' ); return $keys; } ); } } } endif; return new WC_Email_Customer_Fulfillment_Updated(); class-wc-email-customer-fulfillment-deleted.php 0000777 00000014272 15252364676 0015675 0 ustar 00 <?php /** * Class WC_Email_Customer_Fulfillment_Deleted file. * * @package WooCommerce\Emails */ use Automattic\WooCommerce\Internal\Fulfillments\Fulfillment; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } if ( ! class_exists( 'WC_Email_Customer_Fulfillment_Deleted', false ) ) : /** * Customer Fulfillment Deleted Email. * * Fulfillment deleted emails are sent to the customer when the merchant cancels an already fulfilled fulfillment. The notification isn’t sent for draft fulfillments. * * @class WC_Email_Customer_Fulfillment_Deleted * @version 1.0.0 * @package WooCommerce\Classes\Emails * @extends WC_Email */ class WC_Email_Customer_Fulfillment_Deleted extends WC_Email { /** * Fulfillment object. * * @var Fulfillment|null */ private $fulfillment; /** * Constructor. */ public function __construct() { $this->id = 'customer_fulfillment_deleted'; $this->customer_email = true; $this->title = __( 'Fulfillment deleted', 'woocommerce' ); $this->email_group = 'order-updates'; $this->template_html = 'emails/customer-fulfillment-deleted.php'; $this->template_plain = 'emails/plain/customer-fulfillment-deleted.php'; $this->placeholders = array( '{order_date}' => '', '{order_number}' => '', ); // Triggers for this email. add_action( 'woocommerce_fulfillment_deleted_notification', array( $this, 'trigger' ), 10, 3 ); // Call parent constructor. parent::__construct(); $this->description = __( 'Fulfillment deleted emails are sent to the customer when the merchant cancels an already fulfilled fulfillment. The notification isn’t sent for draft fulfillments.', 'woocommerce' ); $this->template_block_content = 'emails/block/general-block-content-for-fulfillment-emails.php'; } /** * Trigger the sending of this email. * * @param int $order_id The order ID. * @param Fulfillment $fulfillment The fulfillment. * @param WC_Order|false $order Order object. */ public function trigger( $order_id, $fulfillment, $order = false ) { $this->setup_locale(); if ( $order_id && ! is_a( $order, 'WC_Order' ) ) { $order = wc_get_order( $order_id ); } if ( is_a( $order, 'WC_Order' ) ) { $this->object = $order; $this->fulfillment = $fulfillment; $this->recipient = $this->object->get_billing_email(); $this->placeholders['{order_date}'] = wc_format_datetime( $this->object->get_date_created() ); $this->placeholders['{order_number}'] = $this->object->get_order_number(); } if ( $this->is_enabled() && $this->get_recipient() ) { $this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() ); } $this->restore_locale(); } /** * Get email subject. * * @since 3.1.0 * @return string */ public function get_default_subject() { return __( 'A shipment from {site_title} order {order_number} has been cancelled', 'woocommerce' ); } /** * Get email heading. * * @since 3.1.0 * @return string */ public function get_default_heading() { return __( 'One of your shipments has been removed', 'woocommerce' ); } /** * Get content html. * * @return string */ public function get_content_html() { $this->maybe_init_fulfillment_for_preview( $this->object ); return wc_get_template_html( $this->template_html, array( 'order' => $this->object, 'fulfillment' => $this->fulfillment, 'email_heading' => $this->get_heading(), 'additional_content' => $this->get_additional_content(), 'sent_to_admin' => false, 'plain_text' => false, 'email' => $this, ) ); } /** * Get content plain. * * @return string */ public function get_content_plain() { $this->maybe_init_fulfillment_for_preview( $this->object ); return wc_get_template_html( $this->template_plain, array( 'order' => $this->object, 'fulfillment' => $this->fulfillment, 'email_heading' => $this->get_heading(), 'additional_content' => $this->get_additional_content(), 'sent_to_admin' => false, 'plain_text' => true, 'email' => $this, ) ); } /** * Get block editor email template content. * * @return string */ public function get_block_editor_email_template_content() { $this->maybe_init_fulfillment_for_preview( $this->object ); return wc_get_template_html( $this->template_block_content, array( 'order' => $this->object, 'fulfillment' => $this->fulfillment, 'sent_to_admin' => false, 'plain_text' => false, 'email' => $this, ) ); } /** * Default content to show below main email content. * * @since 3.7.0 * @return string */ public function get_default_additional_content() { return __( 'If you have any questions or notice anything unexpected, feel free to reach out to our support team through your account or reply to this email.', 'woocommerce' ); } /** * Initialize fulfillment for email preview. * * This method sets up a dummy fulfillment object when the email is being previewed in the admin. * * @param WC_Order $order The order object. * * @since 10.1.0 */ private function maybe_init_fulfillment_for_preview( $order ) { /** * Filter to determine if this is an email preview. * * @since 9.8.0 */ $is_email_preview = apply_filters( 'woocommerce_is_email_preview', false ); if ( $is_email_preview ) { // If this is a preview, we need to set up a dummy fulfillment object. $this->fulfillment = new Fulfillment(); $this->fulfillment->set_items( array_map( function ( $item ) { return array( 'item_id' => $item->get_id(), 'qty' => 1, ); }, $order->get_items() ) ); // Set the deleted status. $this->fulfillment->set_date_deleted( gmdate( 'Y-m-d H:i:s' ) ); } } } endif; return new WC_Email_Customer_Fulfillment_Deleted(); class-wc-email-customer-new-account.php 0000777 00000014377 15252364676 0014201 0 ustar 00 <?php /** * Class WC_Email_Customer_New_Account file. * * @package WooCommerce\Emails */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } if ( ! class_exists( 'WC_Email_Customer_New_Account', false ) ) { /** * Customer New Account. * * An email sent to the customer when they create an account. * * @class WC_Email_Customer_New_Account * @version 3.5.0 * @package WooCommerce\Classes\Emails * @extends WC_Email */ class WC_Email_Customer_New_Account extends WC_Email { /** * User login name. * * @var string */ public $user_login; /** * User email. * * @var string */ public $user_email; /** * User password. * * @var string */ public $user_pass; /** * Is the password generated? * * @var bool */ public $password_generated; /** * Magic link to set initial password. * * @var string */ public $set_password_url; /** * Constructor. */ public function __construct() { $this->id = 'customer_new_account'; $this->customer_email = true; $this->title = __( 'New account', 'woocommerce' ); $this->email_group = 'accounts'; $this->description = __( 'Send an email to customers notifying them that they have created an account', 'woocommerce' ); $this->template_html = 'emails/customer-new-account.php'; $this->template_plain = 'emails/plain/customer-new-account.php'; parent::__construct(); // Must be after parent's constructor which sets `block_email_editor_enabled` property. if ( $this->block_email_editor_enabled ) { $this->title = __( 'Account created', 'woocommerce' ); $this->description = __( 'Notifies customers when their account has been created.', 'woocommerce' ); } } /** * Get email subject. * * @since 3.1.0 * @return string */ public function get_default_subject() { return __( 'Your {site_title} account has been created!', 'woocommerce' ); } /** * Get email heading. * * @since 3.1.0 * @return string */ public function get_default_heading() { return __( 'Welcome to {site_title}', 'woocommerce' ); } /** * Trigger. * * @param int $user_id User ID. * @param string $user_pass User password. * @param bool $password_generated Whether the password was generated automatically or not. */ public function trigger( $user_id, $user_pass = '', $password_generated = false ) { $this->setup_locale(); if ( $user_id ) { $this->object = new WP_User( $user_id ); $this->set_password_url = $this->generate_set_password_url(); $this->user_login = stripslashes( $this->object->user_login ); $this->user_email = stripslashes( $this->object->user_email ); $this->recipient = $this->user_email; $this->user_pass = $user_pass; $this->password_generated = $password_generated; } if ( $this->is_enabled() && $this->get_recipient() ) { $this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() ); } $this->restore_locale(); } /** * Get content html. * * @return string */ public function get_content_html() { return wc_get_template_html( $this->template_html, array( 'email_heading' => $this->get_heading(), 'additional_content' => $this->get_additional_content(), 'user_login' => $this->user_login, 'blogname' => $this->get_blogname(), 'set_password_url' => $this->set_password_url, 'sent_to_admin' => false, 'plain_text' => false, 'email' => $this, 'password_generated' => $this->password_generated, 'user_pass' => $this->user_pass, // Password is no longer used in the template, but we're keeping it here for backwards compatibility with custom templates. ) ); } /** * Get content plain. * * @return string */ public function get_content_plain() { return wc_get_template_html( $this->template_plain, array( 'email_heading' => $this->get_heading(), 'additional_content' => $this->get_additional_content(), 'user_login' => $this->user_login, 'blogname' => $this->get_blogname(), 'set_password_url' => $this->set_password_url, 'sent_to_admin' => false, 'plain_text' => true, 'email' => $this, 'password_generated' => $this->password_generated, 'user_pass' => $this->user_pass, // Password is no longer used in the template, but we're keeping it here for backwards compatibility with custom templates. ) ); } /** * Get block editor email template content. * * @return string */ public function get_block_editor_email_template_content() { return wc_get_template_html( $this->template_block_content, array( 'user_login' => $this->user_login, 'set_password_url' => $this->set_password_url, 'sent_to_admin' => false, 'plain_text' => false, 'email' => $this, 'password_generated' => $this->password_generated, 'user_pass' => $this->user_pass, // Password is no longer used in the template, but we're keeping it here for backwards compatibility with custom templates. ) ); } /** * Default content to show below main email content. * * @since 3.7.0 * @return string */ public function get_default_additional_content() { return __( 'We look forward to seeing you soon.', 'woocommerce' ); } /** * Generate set password URL link for a new user. * * @since 6.0.0 * @return string */ protected function generate_set_password_url() { // Generate a magic link so user can set initial password. $key = get_password_reset_key( $this->object ); if ( is_wp_error( $key ) ) { // Something went wrong while getting the key for new password URL, send customer to the generic password reset. return wc_get_account_endpoint_url( 'lost-password' ); } return sprintf( '%s?action=newaccount&key=%s&login=%s', wc_get_account_endpoint_url( 'lost-password' ), $key, rawurlencode( $this->object->user_login ) ); } } } return new WC_Email_Customer_New_Account(); class-wc-email-new-order.php 0000777 00000023054 15252364676 0012011 0 ustar 00 <?php /** * Class WC_Email_New_Order file * * @package WooCommerce\Emails */ use Automattic\WooCommerce\Utilities\FeaturesUtil; if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'WC_Email_New_Order' ) ) : /** * New Order Email. * * An email sent to the admin when a new order is received/paid for. * * @class WC_Email_New_Order * @version 2.0.0 * @package WooCommerce\Classes\Emails * @extends WC_Email */ class WC_Email_New_Order extends WC_Email { /** * Constructor. */ public function __construct() { $this->id = 'new_order'; $this->title = __( 'New order', 'woocommerce' ); $this->email_group = 'orders'; $this->template_html = 'emails/admin-new-order.php'; $this->template_plain = 'emails/plain/admin-new-order.php'; $this->placeholders = array( '{order_date}' => '', '{order_number}' => '', ); // Triggers for this email. add_action( 'woocommerce_order_status_pending_to_processing_notification', array( $this, 'trigger' ), 10, 2 ); add_action( 'woocommerce_order_status_pending_to_completed_notification', array( $this, 'trigger' ), 10, 2 ); add_action( 'woocommerce_order_status_pending_to_on-hold_notification', array( $this, 'trigger' ), 10, 2 ); add_action( 'woocommerce_order_status_failed_to_processing_notification', array( $this, 'trigger' ), 10, 2 ); add_action( 'woocommerce_order_status_failed_to_completed_notification', array( $this, 'trigger' ), 10, 2 ); add_action( 'woocommerce_order_status_failed_to_on-hold_notification', array( $this, 'trigger' ), 10, 2 ); add_action( 'woocommerce_order_status_cancelled_to_processing_notification', array( $this, 'trigger' ), 10, 2 ); add_action( 'woocommerce_order_status_cancelled_to_completed_notification', array( $this, 'trigger' ), 10, 2 ); add_action( 'woocommerce_order_status_cancelled_to_on-hold_notification', array( $this, 'trigger' ), 10, 2 ); add_action( 'woocommerce_email_footer', array( $this, 'mobile_messaging' ), 9 ); // Run before the default email footer. // Call parent constructor. parent::__construct(); // Must be after parent's constructor which sets `email_improvements_enabled` property. $this->description = $this->email_improvements_enabled ? __( 'Receive an email notification every time a new order is placed', 'woocommerce' ) : __( 'New order emails are sent to chosen recipient(s) when a new order is received.', 'woocommerce' ); // Other settings. $this->recipient = $this->get_option( 'recipient', get_option( 'admin_email' ) ); if ( $this->block_email_editor_enabled ) { $this->description = __( 'Notifies admins when a new order has been placed.', 'woocommerce' ); } } /** * Get email subject. * * @since 3.1.0 * @return string */ public function get_default_subject() { return $this->email_improvements_enabled ? __( '[{site_title}]: You\'ve got a new order: #{order_number}', 'woocommerce' ) : __( '[{site_title}]: New order #{order_number}', 'woocommerce' ); } /** * Get email heading. * * @since 3.1.0 * @return string */ public function get_default_heading() { return $this->email_improvements_enabled ? __( 'New order: #{order_number}', 'woocommerce' ) : __( 'New Order: #{order_number}', 'woocommerce' ); } /** * Trigger the sending of this email. * * @param int $order_id The order ID. * @param WC_Order|false $order Order object. */ public function trigger( $order_id, $order = false ) { $this->setup_locale(); if ( $order_id && ! is_a( $order, 'WC_Order' ) ) { $order = wc_get_order( $order_id ); } $email_already_sent = false; if ( is_a( $order, 'WC_Order' ) ) { $this->object = $order; $this->placeholders['{order_date}'] = wc_format_datetime( $this->object->get_date_created() ); $this->placeholders['{order_number}'] = $this->object->get_order_number(); $email_already_sent = $order->get_new_order_email_sent(); } /** * Controls if new order emails can be resend multiple times. * * @since 5.0.0 * @param bool $allows Defaults to false. */ if ( $email_already_sent && ! apply_filters( 'woocommerce_new_order_email_allows_resend', false ) ) { return; } if ( $this->is_enabled() && $this->get_recipient() ) { $email_sent_successfully = $this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() ); if ( $email_sent_successfully ) { $order->update_meta_data( '_new_order_email_sent', 'true' ); $order->save(); } } $this->restore_locale(); } /** * Get content html. * * @return string */ public function get_content_html() { return wc_get_template_html( $this->template_html, array( 'order' => $this->object, 'email_heading' => $this->get_heading(), 'additional_content' => $this->get_additional_content(), 'sent_to_admin' => true, 'plain_text' => false, 'email' => $this, ) ); } /** * Get content plain. * * @return string */ public function get_content_plain() { return wc_get_template_html( $this->template_plain, array( 'order' => $this->object, 'email_heading' => $this->get_heading(), 'additional_content' => $this->get_additional_content(), 'sent_to_admin' => true, 'plain_text' => true, 'email' => $this, ) ); } /** * Get block editor email template content. * * @return string */ public function get_block_editor_email_template_content() { return wc_get_template_html( $this->template_block_content, array( 'order' => $this->object, 'sent_to_admin' => true, 'plain_text' => false, 'email' => $this, ) ); } /** * Default content to show below main email content. * * @since 3.7.0 * @return string */ public function get_default_additional_content() { return $this->email_improvements_enabled ? __( 'Congratulations on the sale!', 'woocommerce' ) : __( 'Congratulations on the sale.', 'woocommerce' ); } /** * Initialise settings form fields. */ public function init_form_fields() { /* translators: %s: list of placeholders */ $placeholder_text = sprintf( __( 'Available placeholders: %s', 'woocommerce' ), '<code>' . implode( '</code>, <code>', array_keys( $this->placeholders ) ) . '</code>' ); $this->form_fields = array( 'enabled' => array( 'title' => __( 'Enable/Disable', 'woocommerce' ), 'type' => 'checkbox', 'label' => __( 'Enable this email notification', 'woocommerce' ), 'default' => 'yes', ), 'recipient' => array( 'title' => __( 'Recipient(s)', 'woocommerce' ), 'type' => 'text', /* translators: %s: WP admin email */ 'description' => sprintf( __( 'Enter recipients (comma separated) for this email. Defaults to %s.', 'woocommerce' ), '<code>' . esc_attr( get_option( 'admin_email' ) ) . '</code>' ), 'placeholder' => '', 'default' => '', 'desc_tip' => true, ), 'subject' => array( 'title' => __( 'Subject', 'woocommerce' ), 'type' => 'text', 'desc_tip' => true, 'description' => $placeholder_text, 'placeholder' => $this->get_default_subject(), 'default' => '', ), 'heading' => array( 'title' => __( 'Email heading', 'woocommerce' ), 'type' => 'text', 'desc_tip' => true, 'description' => $placeholder_text, 'placeholder' => $this->get_default_heading(), 'default' => '', ), 'additional_content' => array( 'title' => __( 'Additional content', 'woocommerce' ), 'description' => __( 'Text to appear below the main email content.', 'woocommerce' ) . ' ' . $placeholder_text, 'css' => 'width:400px; height: 75px;', 'placeholder' => __( 'N/A', 'woocommerce' ), 'type' => 'textarea', 'default' => $this->get_default_additional_content(), 'desc_tip' => true, ), 'email_type' => array( 'title' => __( 'Email type', 'woocommerce' ), 'type' => 'select', 'description' => __( 'Choose which format of email to send.', 'woocommerce' ), 'default' => 'html', 'class' => 'email_type wc-enhanced-select', 'options' => $this->get_email_type_options(), 'desc_tip' => true, ), ); if ( FeaturesUtil::feature_is_enabled( 'email_improvements' ) ) { $this->form_fields['cc'] = $this->get_cc_field(); $this->form_fields['bcc'] = $this->get_bcc_field(); } if ( $this->block_email_editor_enabled ) { $this->form_fields['preheader'] = $this->get_preheader_field(); } } /** * Add mobile messaging. * * @param WC_Email $email that called for mobile messaging. May not contain a WC_Email for legacy reasons. */ public function mobile_messaging( $email ) { if ( $email instanceof WC_Email_New_Order && null !== $this->object ) { $domain = wp_parse_url( home_url(), PHP_URL_HOST ); wc_get_template( 'emails/email-mobile-messaging.php', array( 'order' => $this->object, 'blog_id' => class_exists( 'Jetpack_Options' ) ? Jetpack_Options::get_option( 'id' ) : null, 'now' => new DateTime(), 'domain' => is_string( $domain ) ? $domain : '', ) ); } } } endif; return new WC_Email_New_Order(); class-wc-email-customer-on-hold-order.php 0000777 00000011336 15252364676 0014417 0 ustar 00 <?php /** * Class WC_Email_Customer_On_Hold_Order file. * * @package WooCommerce\Emails */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } if ( ! class_exists( 'WC_Email_Customer_On_Hold_Order', false ) ) : /** * Customer On-hold Order Email. * * An email sent to the customer when a new order is on-hold for. * * @class WC_Email_Customer_On_Hold_Order * @version 2.6.0 * @package WooCommerce\Classes\Emails * @extends WC_Email */ class WC_Email_Customer_On_Hold_Order extends WC_Email { /** * Constructor. */ public function __construct() { $this->id = 'customer_on_hold_order'; $this->customer_email = true; $this->title = __( 'Order on-hold', 'woocommerce' ); $this->email_group = 'order-changes'; $this->template_html = 'emails/customer-on-hold-order.php'; $this->template_plain = 'emails/plain/customer-on-hold-order.php'; $this->placeholders = array( '{order_date}' => '', '{order_number}' => '', ); // Triggers for this email. add_action( 'woocommerce_order_status_pending_to_on-hold_notification', array( $this, 'trigger' ), 10, 2 ); add_action( 'woocommerce_order_status_failed_to_on-hold_notification', array( $this, 'trigger' ), 10, 2 ); add_action( 'woocommerce_order_status_cancelled_to_on-hold_notification', array( $this, 'trigger' ), 10, 2 ); // Call parent constructor. parent::__construct(); // Must be after parent's constructor which sets `email_improvements_enabled` property. $this->description = $this->email_improvements_enabled ? __( 'Send an email to customers notifying them when their order has been placed on hold', 'woocommerce' ) : __( 'This is an order notification sent to customers containing order details after an order is placed on-hold from Pending, Cancelled or Failed order status.', 'woocommerce' ); if ( $this->block_email_editor_enabled ) { $this->title = __( 'Order on hold', 'woocommerce' ); $this->description = __( 'Notifies customers when their order has been placed on hold.', 'woocommerce' ); } } /** * Get email subject. * * @since 3.1.0 * @return string */ public function get_default_subject() { return __( 'Your {site_title} order has been received!', 'woocommerce' ); } /** * Get email heading. * * @since 3.1.0 * @return string */ public function get_default_heading() { return __( 'Thank you for your order', 'woocommerce' ); } /** * Trigger the sending of this email. * * @param int $order_id The order ID. * @param WC_Order|false $order Order object. */ public function trigger( $order_id, $order = false ) { $this->setup_locale(); if ( $order_id && ! is_a( $order, 'WC_Order' ) ) { $order = wc_get_order( $order_id ); } if ( is_a( $order, 'WC_Order' ) ) { $this->object = $order; $this->recipient = $this->object->get_billing_email(); $this->placeholders['{order_date}'] = wc_format_datetime( $this->object->get_date_created() ); $this->placeholders['{order_number}'] = $this->object->get_order_number(); } if ( $this->is_enabled() && $this->get_recipient() ) { $this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() ); } $this->restore_locale(); } /** * Get content html. * * @return string */ public function get_content_html() { return wc_get_template_html( $this->template_html, array( 'order' => $this->object, 'email_heading' => $this->get_heading(), 'additional_content' => $this->get_additional_content(), 'sent_to_admin' => false, 'plain_text' => false, 'email' => $this, ) ); } /** * Get content plain. * * @return string */ public function get_content_plain() { return wc_get_template_html( $this->template_plain, array( 'order' => $this->object, 'email_heading' => $this->get_heading(), 'additional_content' => $this->get_additional_content(), 'sent_to_admin' => false, 'plain_text' => true, 'email' => $this, ) ); } /** * Default content to show below main email content. * * @since 3.7.0 * @return string */ public function get_default_additional_content() { return $this->email_improvements_enabled ? __( 'Thanks again! If you need any help with your order, please contact us at {store_email}.', 'woocommerce' ) : __( 'We look forward to fulfilling your order soon.', 'woocommerce' ); } } endif; return new WC_Email_Customer_On_Hold_Order(); class-wc-email-customer-fulfillment-created.php 0000777 00000015567 15252364676 0015706 0 ustar 00 <?php /** * Class WC_Email_Customer_Fulfillment_Created file. * * @package WooCommerce\Emails */ use Automattic\WooCommerce\Internal\Fulfillments\Fulfillment; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } if ( ! class_exists( 'WC_Email_Customer_Fulfillment_Created', false ) ) : /** * Customer Fulfillment Created Email. * * Fulfillment created emails are sent to the customer when the merchant creates a fulfillment for the order, and marks it as fulfilled. The notification isn’t sent for draft fulfillments. * * @class WC_Email_Customer_Fulfillment_Created * @version 1.0.0 * @package WooCommerce\Classes\Emails * @extends WC_Email */ class WC_Email_Customer_Fulfillment_Created extends WC_Email { /** * Fulfillment object. * * @var Fulfillment|null */ private $fulfillment; /** * Constructor. */ public function __construct() { $this->id = 'customer_fulfillment_created'; $this->customer_email = true; $this->title = __( 'Fulfillment created', 'woocommerce' ); $this->email_group = 'order-updates'; $this->template_html = 'emails/customer-fulfillment-created.php'; $this->template_plain = 'emails/plain/customer-fulfillment-created.php'; $this->placeholders = array( '{order_date}' => '', '{order_number}' => '', ); // Triggers for this email. add_action( 'woocommerce_fulfillment_created_notification', array( $this, 'trigger' ), 10, 3 ); // Call parent constructor. parent::__construct(); $this->description = __( 'Fulfillment created emails are sent to the customer when the merchant creates a fulfillment for the order, and marks it as fulfilled. The notification isn’t sent for draft fulfillments.', 'woocommerce' ); $this->template_block_content = 'emails/block/general-block-content-for-fulfillment-emails.php'; } /** * Trigger the sending of this email. * * @param int $order_id The order ID. * @param Fulfillment $fulfillment The fulfillment. * @param WC_Order|false $order Order object. */ public function trigger( $order_id, $fulfillment, $order = false ) { $this->setup_locale(); if ( $order_id && ! is_a( $order, 'WC_Order' ) ) { $order = wc_get_order( $order_id ); } if ( is_a( $order, 'WC_Order' ) ) { $this->object = $order; $this->fulfillment = $fulfillment; $this->recipient = $this->object->get_billing_email(); $this->placeholders['{order_date}'] = wc_format_datetime( $this->object->get_date_created() ); $this->placeholders['{order_number}'] = $this->object->get_order_number(); } if ( $this->is_enabled() && $this->get_recipient() ) { $this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() ); } $this->restore_locale(); } /** * Get email subject. * * @since 3.1.0 * @return string */ public function get_default_subject() { return __( 'An item from {site_title} order {order_number} has been fulfilled!', 'woocommerce' ); } /** * Get email heading. * * @since 3.1.0 * @return string */ public function get_default_heading() { return __( 'Your item is on the way!', 'woocommerce' ); } /** * Get content html. * * @return string */ public function get_content_html() { $this->maybe_init_fulfillment_for_preview( $this->object ); return wc_get_template_html( $this->template_html, array( 'order' => $this->object, 'fulfillment' => $this->fulfillment, 'email_heading' => $this->get_heading(), 'additional_content' => $this->get_additional_content(), 'sent_to_admin' => false, 'plain_text' => false, 'email' => $this, ) ); } /** * Get content plain. * * @return string */ public function get_content_plain() { $this->maybe_init_fulfillment_for_preview( $this->object ); return wc_get_template_html( $this->template_plain, array( 'order' => $this->object, 'fulfillment' => $this->fulfillment, 'email_heading' => $this->get_heading(), 'additional_content' => $this->get_additional_content(), 'sent_to_admin' => false, 'plain_text' => true, 'email' => $this, ) ); } /** * Get block editor email template content. * * @return string */ public function get_block_editor_email_template_content() { $this->maybe_init_fulfillment_for_preview( $this->object ); return wc_get_template_html( $this->template_block_content, array( 'order' => $this->object, 'fulfillment' => $this->fulfillment, 'sent_to_admin' => false, 'plain_text' => false, 'email' => $this, ) ); } /** * Default content to show below main email content. * * @since 3.7.0 * @return string */ public function get_default_additional_content() { return __( 'Please note that couriers may need some time to provide the latest shipping information.', 'woocommerce' ); } /** * Initialize fulfillment for email preview. * * This method sets up a dummy fulfillment object when the email is being previewed in the admin. * * @param WC_Order $order The order object. * * @since 10.1.0 */ private function maybe_init_fulfillment_for_preview( $order ) { /** * Filter to determine if this is an email preview. * * @since 9.8.0 */ $is_email_preview = apply_filters( 'woocommerce_is_email_preview', false ); if ( $is_email_preview ) { // If this is a preview, we need to set up a dummy fulfillment object. $this->fulfillment = new Fulfillment(); $this->fulfillment->set_items( array_map( function ( $item ) { return array( 'item_id' => $item->get_id(), 'qty' => 1, ); }, $order->get_items() ) ); // Some private meta data to simulate a real fulfillment. $this->fulfillment->add_meta_data( '_tracking_number', '123456789' ); $this->fulfillment->add_meta_data( '_shipment_provider', 'dhl' ); $this->fulfillment->add_meta_data( '_tracking_url', 'https://www.dhl.com/tracking/123456789' ); // Some public data to simulate a real fulfillment. $this->fulfillment->add_meta_data( 'service', 'Standard Shipping' ); $this->fulfillment->add_meta_data( 'expected_delivery', '2025-06-30' ); // Add translations for metadata keys. add_filter( 'woocommerce_fulfillment_meta_key_translations', function ( $keys ) { $keys['service'] = __( 'Service', 'woocommerce' ); $keys['expected_delivery'] = __( 'Expected Delivery', 'woocommerce' ); return $keys; } ); } } } endif; return new WC_Email_Customer_Fulfillment_Created(); summary-report-email.css 0000777 00000005131 15252760366 0011374 0 ustar 00 /* General styles. */ #outlook a { padding: 0; } .ExternalClass { width: 100%; } .ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div { line-height: 100%; } #backgroundTable { margin: 0; padding: 0; width: 100% !important; line-height: 100% !important; } /* Prevent blue links in subject. */ .stats-subject-heading a { color: inherit !important; text-decoration: none !important; } /* Mobile styles. */ @media only screen and (max-width: 599px) { table.body .container { margin: 0 auto !important; width: auto !important; max-width: 600px !important; } .header img { width: 240px !important; height: auto !important; } .content { padding: 30px !important; } .main-heading { font-size: 16px !important; line-height: 20px !important; } .main-description { margin-bottom: 20px !important; } .spacer-40 { line-height: 20px !important; height: 20px !important; } .upgrade-heading { font-size: 18px !important; line-height: 22px !important; } .upgrade-text { font-size: 14px !important; line-height: 20px !important; } } @media only screen and (max-width: 360px) { .content { padding: 20px !important; } } /* Dark Mode. */ @media (prefers-color-scheme: dark) { .dark-body-bg { background: #1C1E20 !important; } .dark-content-bg { background: #23282C !important; } .dark-bg { background: #202326 !important; } .dark-white-color { color: #ffffff !important; } .dark-img { display: block !important; width: auto !important; overflow: visible !important; float: none !important; max-height: inherit !important; max-width: inherit !important; line-height: auto !important; margin-top: 0px !important; visibility: inherit !important; } .light-img { display: none; display: none !important; } .upgrade-text, .footer { color: #8C8F94 !important; } } /* Dark Mode Outlook. */ [data-ogsc] .dark-body-bg { background: #1C1E20 !important; } [data-ogsc] .dark-content-bg { background: #23282C !important; } [data-ogsc] .dark-bg { background: #202326 !important; } [data-ogsc] .dark-white-color { color: #ffffff !important; } [data-ogsc] .dark-img { display: block !important; width: auto !important; overflow: visible !important; float: none !important; max-height: inherit !important; max-width: inherit !important; line-height: auto !important; margin-top: 0px !important; visibility: inherit !important; } [data-ogsc] .light-img { display: none; display: none !important; } [data-ogsc] .upgrade-text, [data-ogsc] .footer { color: #8C8F94 !important; } email-header.php 0000777 00000010212 15253050367 0007603 0 ustar 00 <?php /** * Email Header * * This template can be overridden by copying it to yourtheme/woocommerce/emails/email-header.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails * @version 10.4.0 */ use Automattic\WooCommerce\Utilities\FeaturesUtil; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } $email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' ); $store_name = $store_name ?? get_bloginfo( 'name', 'display' ); ?> <!DOCTYPE html> <html <?php language_attributes(); ?>> <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php bloginfo( 'charset' ); ?>" /> <meta content="width=device-width, initial-scale=1.0" name="viewport"> <title><?php echo esc_html( $store_name ); ?></title> </head> <body <?php echo is_rtl() ? 'rightmargin' : 'leftmargin'; ?>="0" marginwidth="0" topmargin="0" marginheight="0" offset="0"> <table width="100%" id="outer_wrapper" role="presentation"> <tr> <td><!-- Deliberately empty to support consistent sizing and layout across multiple email clients. --></td> <td width="600"> <div id="wrapper" dir="<?php echo is_rtl() ? 'rtl' : 'ltr'; ?>"> <table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="inner_wrapper" role="presentation"> <tr> <td align="center" valign="top"> <?php $img = get_option( 'woocommerce_email_header_image' ); /** * This filter is documented in templates/emails/email-styles.php * * @since 9.6.0 */ if ( apply_filters( 'woocommerce_is_email_preview', false ) ) { $img_transient = get_transient( 'woocommerce_email_header_image' ); $img = false !== $img_transient ? $img_transient : $img; } if ( $email_improvements_enabled ) : ?> <table border="0" cellpadding="0" cellspacing="0" width="100%" role="presentation"> <tr> <td id="template_header_image"> <?php if ( $img ) { echo '<p style="margin-top:0;"><img src="' . esc_url( $img ) . '" alt="' . esc_attr( $store_name ) . '" /></p>'; } else { echo '<p class="email-logo-text">' . esc_html( $store_name ) . '</p>'; } ?> </td> </tr> </table> <?php else : ?> <div id="template_header_image"> <?php if ( $img ) { echo '<p style="margin-top:0;"><img src="' . esc_url( $img ) . '" alt="' . esc_attr( $store_name ) . '" /></p>'; } ?> </div> <?php endif; ?> <table border="0" cellpadding="0" cellspacing="0" width="100%" id="template_container" role="presentation"> <tr> <td align="center" valign="top"> <!-- Header --> <table border="0" cellpadding="0" cellspacing="0" width="100%" id="template_header" role="presentation"> <tr> <td id="header_wrapper"> <h1><?php echo esc_html( $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="100%" id="template_body" role="presentation"> <tr> <td valign="top" id="body_content"> <!-- Content --> <table border="0" cellpadding="20" cellspacing="0" width="100%" role="presentation"> <tr> <td valign="top" id="body_content_inner_cell"> <div id="body_content_inner"> email-fulfillment-details.php 0000777 00000010374 15253050367 0012330 0 ustar 00 <?php /** * Order fulfillment details table shown in emails. * * This template can be overridden by copying it to yourtheme/woocommerce/emails/email-fulfillment-details.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails * @version 10.1.0 */ defined( 'ABSPATH' ) || exit; $text_align = is_rtl() ? 'right' : 'left'; $heading_class = 'email-order-detail-heading'; $order_table_class = 'email-order-details'; $order_total_text_align = 'right'; if ( null === $fulfillment->get_date_deleted() ) { $tracking_number = $fulfillment->get_meta( '_tracking_number', true ); $tracking_url = $fulfillment->get_meta( '_tracking_url' ); $shipment_provider = $fulfillment->get_meta( '_shipment_provider' ); if ( ! $tracking_number && ! $tracking_url && ! $shipment_provider ) { echo '<p>' . esc_html__( 'No tracking information available for this fulfillment at the moment.', 'woocommerce' ) . '</p>'; } else { echo '<p><strong>' . esc_html__( 'Tracking Number', 'woocommerce' ) . ':</strong> ' . esc_attr( $tracking_number ) . '</p>'; echo '<p><strong>' . esc_html__( 'Shipment Provider', 'woocommerce' ) . ':</strong> ' . esc_html( $shipment_provider ) . '</p>'; echo '<p><a href="' . esc_url( $tracking_url ) . '" target="_blank">' . esc_attr__( 'Track your shipment', 'woocommerce' ) . '</a></p>'; } echo '<br />'; echo '<p>'; echo wp_kses_post( sprintf( /* translators: %s: Link to My Account > Orders page. */ __( 'You can access to more details of your order by visiting <a href="%s" target="_blank">My Account > Orders</a> and select the order you wish to see the latest status of the delivery.', 'woocommerce' ), site_url( 'my-account/orders/' ) ) ); echo '</p>'; } /** * Action hook to add custom content before fulfillment details in email. * * @param WC_Order $order Order object. * @param Fulfillment $fulfillment Fulfillment object. * @param bool $sent_to_admin Whether it's sent to admin or customer. * @param bool $plain_text Whether it's a plain text email. * @param WC_Email $email Email object. * @since 2.5.0 */ do_action( 'woocommerce_email_before_fulfillment_table', $order, $fulfillment, $sent_to_admin, $plain_text, $email ); ?> <h2 class="<?php echo esc_attr( $heading_class ); ?>"> <?php echo wp_kses_post( __( 'Fulfillment summary', 'woocommerce' ) ); if ( $sent_to_admin ) { $before = '<a class="link" href="' . esc_url( $order->get_edit_order_url() ) . '">'; $after = '</a>'; } else { $before = ''; $after = ''; } echo '<br><span>'; /* translators: %s: Order ID. */ $order_number_string = __( 'Order #%s', 'woocommerce' ); echo wp_kses_post( $before . sprintf( $order_number_string . $after . ' (<time datetime="%s">%s</time>)', $order->get_order_number(), $order->get_date_created()->format( 'c' ), wc_format_datetime( $order->get_date_created() ) ) ); echo '</span>'; ?> </h2> <div style="margin-bottom: 24px;"> <table class="td font-family <?php echo esc_attr( $order_table_class ); ?>" cellspacing="0" cellpadding="6" style="width: 100%;" border="1"> <tbody> <?php echo wc_get_email_fulfillment_items( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped $order, $fulfillment, array( 'show_sku' => $sent_to_admin, 'show_image' => true, 'image_size' => array( 48, 48 ), 'plain_text' => $plain_text, 'sent_to_admin' => $sent_to_admin, ) ); ?> </tbody> </table> </div> <?php /** * Action hook to add custom content after fulfillment details in email. * * @param WC_Order $order Order object. * @param bool $sent_to_admin Whether it's sent to admin or customer. * @param bool $plain_text Whether it's a plain text email. * @param WC_Email $email Email object. * @since 2.5.0 */ do_action( 'woocommerce_email_after_fulfillment_table', $order, $fulfillment, $sent_to_admin, $plain_text, $email ); ?> customer-stock-notification-verified.php 0000777 00000007077 15253050367 0014546 0 ustar 00 <?php /** * Customer back-in-stock notification confirmation email. * * This template can be overridden by copying it to yourtheme/woocommerce/emails/customer-stock-notification-verified.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails * @version 10.2.0 */ // Exit if accessed directly. if ( ! defined( 'ABSPATH' ) ) { exit; } /** * Hook: woocommerce_email_header. * * @since 10.2.0 * * @hooked WC_Emails::email_header() Output the email header */ do_action( 'woocommerce_email_header', $email_heading, $email ); ?> <table border="0" cellpadding="0" cellspacing="0" id="notification__container"><tr><td> <div id="notification__into_content"> <?php echo wp_kses_post( wpautop( wptexturize( $intro_content ) ) ); ?> </div> <div id="notification__product"> <?php /** * Hook: woocommerce_email_stock_notification_product. * * @since 10.2.0 * * @hooked \Automattic\WooCommerce\Internal\StockNotifications\Templates::email_product_image - 10 * @hooked \Automattic\WooCommerce\Internal\StockNotifications\Templates::email_product_title - 20 * @hooked \Automattic\WooCommerce\Internal\StockNotifications\Templates::email_product_attributes - 30 * @hooked \Automattic\WooCommerce\Internal\StockNotifications\Templates::email_product_price - 40 */ do_action( 'woocommerce_email_stock_notification_product', $product, $notification, $plain_text, $email ); ?> </div> <table id="notification__footer"><tr><td> <?php echo esc_html( sprintf( __( 'You have received this message because your e-mail address was used to sign up for stock notifications on our store.', 'woocommerce' ), $product->get_name() ) ); if ( ! $is_guest ) { // translators: %1$s placeholder is the unsubscribe link, %2$s placeholder is the Unsubscribe text link. $unsubscribe_link_tag = sprintf( '<a href="%1$s" id="notification__unsubscribe_link">%2$s</a>', esc_url( $unsubscribe_link ), _x( 'click here', 'unsubscribe cta for stock notifications for existing customers', 'woocommerce' ) ); // translators: %s placeholder is the text part from above. echo wp_kses_post( sprintf( __( 'To manage your notifications, %s to log in to your account.', 'woocommerce' ), $unsubscribe_link_tag ) ); } else { // translators: %1$s placeholder is the unsubscribe link, %2$s placeholder is the Unsubscribe text link. $unsubscribe_link_tag = sprintf( '<a href="%1$s" id="notification__unsubscribe_link">%2$s</a>', esc_url( $unsubscribe_link ), _x( 'click here', 'unsubscribe cta for stock notifications for guests', 'woocommerce' ) ); // translators: %s placeholder is the text part from above. echo wp_kses_post( sprintf( __( 'To stop receiving these messages, %s to unsubscribe.', 'woocommerce' ), $unsubscribe_link_tag ) ); } ?> <br><br> <?php /** * Show user-defined additional content - this is set in each email's settings. */ if ( $additional_content ) { echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) ); } ?> </td></tr></table> </td></tr></table> <?php /** * Hook: woocommerce_email_footer. * * @since 10.2.0 * * @hooked WC_Emails::email_footer() Output the email footer */ do_action( 'woocommerce_email_footer', $email ); email-order-items.php 0000777 00000016741 15253050367 0010622 0 ustar 00 <?php /** * Email Order Items * * This template can be overridden by copying it to yourtheme/woocommerce/emails/email-order-items.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails * @version 10.4.0 */ use Automattic\WooCommerce\Utilities\FeaturesUtil; defined( 'ABSPATH' ) || exit; $margin_side = is_rtl() ? 'left' : 'right'; $email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' ); $price_text_align = $email_improvements_enabled ? 'right' : 'left'; foreach ( $items as $item_id => $item ) : $product = $item->get_product(); $sku = ''; $purchase_note = ''; $image = ''; if ( ! apply_filters( 'woocommerce_order_item_visible', true, $item ) ) { continue; } if ( is_object( $product ) ) { $sku = $product->get_sku(); $purchase_note = $product->get_purchase_note(); $image = $product->get_image( $image_size ); } ?> <tr class="<?php echo esc_attr( apply_filters( 'woocommerce_order_item_class', 'order_item', $item, $order ) ); ?>"> <td class="td font-family text-align-left" style="vertical-align: middle; word-wrap:break-word;"> <?php if ( $email_improvements_enabled ) { ?> <table class="order-item-data" role="presentation"> <tr> <?php // Show title/image etc. if ( $show_image ) { /** * Email Order Item Thumbnail hook. * * @param string $image The image HTML. * @param WC_Order_Item_Product $item The item being displayed. * @since 2.1.0 */ echo '<td>' . wp_kses_post( apply_filters( 'woocommerce_order_item_thumbnail', $image, $item ) ) . '</td>'; } ?> <td> <?php /** * Order Item Name hook. * * @param string $item_name The item name HTML. * @param WC_Order_Item_Product $item The item being displayed. * @since 2.1.0 */ $order_item_name = apply_filters( 'woocommerce_order_item_name', $item->get_name(), $item, false ); echo wp_kses_post( "<h3 style='font-size: inherit;font-weight: inherit;'>{$order_item_name}</h3>" ); // SKU. if ( $show_sku && $sku ) { echo wp_kses_post( ' (#' . $sku . ')' ); } /** * Allow other plugins to add additional product information. * * @param int $item_id The item ID. * @param WC_Order_Item_Product $item The item object. * @param WC_Order $order The order object. * @param bool $plain_text Whether the email is plain text or not. * @since 2.3.0 */ do_action( 'woocommerce_order_item_meta_start', $item_id, $item, $order, $plain_text ); $item_meta = wc_display_item_meta( $item, array( 'before' => '', 'after' => '', 'separator' => '<br>', 'echo' => false, 'label_before' => '<span>', 'label_after' => ':</span> ', ) ); echo '<div class="email-order-item-meta">'; // Using wp_kses instead of wp_kses_post to remove all block elements. echo wp_kses( $item_meta, array( 'br' => array(), 'span' => array(), 'a' => array( 'href' => true, 'target' => true, 'rel' => true, 'title' => true, ), ) ); echo '</div>'; /** * Allow other plugins to add additional product information. * * @param int $item_id The item ID. * @param WC_Order_Item_Product $item The item object. * @param WC_Order $order The order object. * @param bool $plain_text Whether the email is plain text or not. * @since 2.3.0 */ do_action( 'woocommerce_order_item_meta_end', $item_id, $item, $order, $plain_text ); ?> </td> </tr> </table> <?php } else { // Show title/image etc. if ( $show_image ) { /** * Email Order Item Thumbnail hook. * * @param string $image The image HTML. * @param WC_Order_Item_Product $item The item being displayed. * @since 2.1.0 */ echo wp_kses_post( apply_filters( 'woocommerce_order_item_thumbnail', $image, $item ) ); } /** * Order Item Name hook. * * @param string $item_name The item name HTML. * @param WC_Order_Item_Product $item The item being displayed. * @since 2.1.0 */ echo wp_kses_post( apply_filters( 'woocommerce_order_item_name', $item->get_name(), $item, false ) ); // SKU. if ( $show_sku && $sku ) { echo wp_kses_post( ' (#' . $sku . ')' ); } /** * Allow other plugins to add additional product information. * * @param int $item_id The item ID. * @param WC_Order_Item_Product $item The item object. * @param WC_Order $order The order object. * @param bool $plain_text Whether the email is plain text or not. * @since 2.3.0 */ do_action( 'woocommerce_order_item_meta_start', $item_id, $item, $order, $plain_text ); wc_display_item_meta( $item, array( 'label_before' => '<strong class="wc-item-meta-label" style="float: ' . ( is_rtl() ? 'right' : 'left' ) . '; margin-' . esc_attr( $margin_side ) . ': .25em; clear: both">', ) ); /** * Allow other plugins to add additional product information. * * @param int $item_id The item ID. * @param WC_Order_Item_Product $item The item object. * @param WC_Order $order The order object. * @param bool $plain_text Whether the email is plain text or not. * @since 2.3.0 */ do_action( 'woocommerce_order_item_meta_end', $item_id, $item, $order, $plain_text ); } ?> </td> <td class="td font-family text-align-<?php echo esc_attr( $price_text_align ); ?>" style="vertical-align:middle;"> <?php echo $email_improvements_enabled ? '×' : ''; $qty = $item->get_quantity(); $refunded_qty = $order->get_qty_refunded_for_item( $item_id ); if ( $refunded_qty ) { $qty_display = '<del>' . esc_html( $qty ) . '</del> <ins>' . esc_html( $qty - ( $refunded_qty * -1 ) ) . '</ins>'; } else { $qty_display = esc_html( $qty ); } echo wp_kses_post( apply_filters( 'woocommerce_email_order_item_quantity', $qty_display, $item ) ); ?> </td> <td class="td font-family text-align-<?php echo esc_attr( $price_text_align ); ?>" style="vertical-align:middle;"> <?php echo wp_kses_post( $order->get_formatted_line_subtotal( $item ) ); ?> </td> </tr> <?php if ( $show_purchase_note && $purchase_note ) { ?> <tr> <td colspan="3" class="font-family text-align-left" style="vertical-align:middle;"> <?php echo wp_kses_post( wpautop( do_shortcode( $purchase_note ) ) ); ?> </td> </tr> <?php } ?> <?php endforeach; ?> email-styles.php 0000777 00000036535 15253050367 0007716 0 ustar 00 <?php /** * Email Styles * * This template can be overridden by copying it to yourtheme/woocommerce/emails/email-styles.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails * @version 10.5.0 */ use Automattic\WooCommerce\Internal\Email\EmailFont; use Automattic\WooCommerce\Utilities\FeaturesUtil; if ( ! defined( 'ABSPATH' ) ) { exit; } $email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' ); // Load colors. $bg = get_option( 'woocommerce_email_background_color' ); $body = get_option( 'woocommerce_email_body_background_color' ); $base = get_option( 'woocommerce_email_base_color' ); $text = get_option( 'woocommerce_email_text_color' ); $footer_text = get_option( 'woocommerce_email_footer_text_color' ); $header_alignment = get_option( 'woocommerce_email_header_alignment', $email_improvements_enabled ? 'left' : false ); $logo_image_width = get_option( 'woocommerce_email_header_image_width', '120' ); $default_font = 'Helvetica'; $font_family = $email_improvements_enabled ? get_option( 'woocommerce_email_font_family', $default_font ) : $default_font; /** * Check if we are in preview mode (WooCommerce > Settings > Emails). * * @since 9.6.0 * @param bool $is_email_preview Whether the email is being previewed. */ $is_email_preview = apply_filters( 'woocommerce_is_email_preview', false ); if ( $is_email_preview ) { $bg_transient = get_transient( 'woocommerce_email_background_color' ); $body_transient = get_transient( 'woocommerce_email_body_background_color' ); $base_transient = get_transient( 'woocommerce_email_base_color' ); $text_transient = get_transient( 'woocommerce_email_text_color' ); $footer_text_transient = get_transient( 'woocommerce_email_footer_text_color' ); $header_alignment_transient = get_transient( 'woocommerce_email_header_alignment' ); $logo_image_width_transient = get_transient( 'woocommerce_email_header_image_width' ); $font_family_transient = get_transient( 'woocommerce_email_font_family' ); $bg = $bg_transient ? $bg_transient : $bg; $body = $body_transient ? $body_transient : $body; $base = $base_transient ? $base_transient : $base; $text = $text_transient ? $text_transient : $text; $footer_text = $footer_text_transient ? $footer_text_transient : $footer_text; $header_alignment = $header_alignment_transient ? $header_alignment_transient : $header_alignment; $logo_image_width = $logo_image_width_transient ? $logo_image_width_transient : $logo_image_width; $font_family = $font_family_transient ? $font_family_transient : $font_family; } // Only use safe fonts. They won't be escaped to preserve single quotes. $safe_font_family = EmailFont::$font[ $font_family ] ?? EmailFont::$font[ $default_font ]; $base_text = wc_light_or_dark( $base, '#202020', '#ffffff' ); // Pick a contrasting color for links. $link_color = wc_hex_is_light( $base ) ? $base : $base_text; if ( wc_hex_is_light( $body ) ) { $link_color = wc_hex_is_light( $base ) ? $base_text : $base; } // If email improvements are enabled, always use the base color for links. if ( $email_improvements_enabled ) { $link_color = $base; } $border_color = wc_light_or_dark( $body, 'rgba(0, 0, 0, .2)', 'rgba(255, 255, 255, .2)' ); $bg_darker_10 = wc_hex_darker( $bg, 10 ); $body_darker_10 = wc_hex_darker( $body, 10 ); $base_lighter_20 = wc_hex_lighter( $base, 20 ); $base_lighter_40 = wc_hex_lighter( $base, 40 ); $text_lighter_20 = wc_hex_lighter( $text, 20 ); $text_lighter_40 = wc_hex_lighter( $text, 40 ); // !important; is a gmail hack to prevent styles being stripped if it doesn't like something. // body{padding: 0;} ensures proper scale/positioning of the email in the iOS native email app. ?> body { background-color: <?php echo esc_attr( $bg ); ?>; padding: 0; text-align: center; } #outer_wrapper { background-color: <?php echo esc_attr( $bg ); ?>; } <?php if ( $email_improvements_enabled ) : ?> #inner_wrapper { background-color: <?php echo esc_attr( $body ); ?>; border-radius: 8px; } <?php endif; ?> #wrapper { margin: 0 auto; padding: <?php echo $email_improvements_enabled ? '24px 0' : '70px 0'; ?>; -webkit-text-size-adjust: none !important; width: 100%; max-width: 600px; } #template_container { box-shadow: <?php echo $email_improvements_enabled ? 'none' : '0 1px 4px rgba(0, 0, 0, 0.1) !important'; ?>; background-color: <?php echo esc_attr( $body ); ?>; border: <?php echo $email_improvements_enabled ? '0' : '1px solid ' . esc_attr( $bg_darker_10 ); ?>; border-radius: 3px !important; } #template_header { background-color: <?php echo esc_attr( $email_improvements_enabled ? $body : $base ); ?>; border-radius: 3px 3px 0 0 !important; color: <?php echo esc_attr( $email_improvements_enabled ? $text : $base_text ); ?>; border-bottom: 0; font-weight: bold; line-height: 100%; vertical-align: middle; font-family: <?php echo $safe_font_family; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>; } #template_header h1, #template_header h1 a { color: <?php echo esc_attr( $email_improvements_enabled ? $text : $base_text ); ?>; background-color: inherit; } <?php if ( $email_improvements_enabled ) : ?> .hr { border-bottom: 1px solid #1e1e1e; opacity: 0.2; margin: 16px 0; } .hr-top { margin-top: 32px; } .hr-bottom { margin-bottom: 32px; } #template_header_image { padding: 32px 32px 0; } #template_header_image p { margin-bottom: 0; text-align: <?php echo esc_attr( $header_alignment ); ?>; } #template_header_image img { width: <?php echo esc_attr( $logo_image_width ); ?>px; } .email-logo-text { color: <?php echo esc_attr( $link_color ); ?>; font-family: <?php echo $safe_font_family; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>; font-size: 18px; } .email-introduction { padding-bottom: 24px; } .email-order-item-meta { color: <?php echo esc_attr( $footer_text ); ?>; font-size: 14px; line-height: 140%; } #body_content table td td.email-additional-content { color: <?php echo esc_attr( $text ); ?>; font-family: <?php echo $safe_font_family; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>; padding: 32px 0 0; } .email-additional-content p { text-align: center; } .email-additional-content-aligned p { text-align: <?php echo is_rtl() ? 'right' : 'left'; ?>; } <?php else : ?> #template_header_image img { margin-left: 0; margin-right: 0; } <?php endif; ?> #template_footer td { padding: 0; border-radius: <?php echo $email_improvements_enabled ? '0' : '6px'; ?>; } #template_footer #credit { border: 0; <?php if ( $email_improvements_enabled ) : ?> border-top: 1px solid <?php echo esc_attr( $border_color ); ?>; <?php endif; ?> color: <?php echo esc_attr( $footer_text ); ?>; font-family: <?php echo $safe_font_family; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>; font-size: 12px; line-height: <?php echo $email_improvements_enabled ? '140%' : '150%'; ?>; text-align: center; padding: <?php echo $email_improvements_enabled ? '32px' : '24px 0'; ?>; } #template_footer #credit p { margin: <?php echo $email_improvements_enabled ? '0' : '0 0 16px'; ?>; } #body_content { background-color: <?php echo esc_attr( $body ); ?>; } #body_content table td { padding: <?php echo $email_improvements_enabled ? '20px 32px 32px' : '48px 48px 32px'; ?>; } #body_content table td td { padding: 12px; } #body_content table td th { padding: 12px; } #body_content table .email-order-details td, #body_content table .email-order-details th { padding: 8px 12px; } #body_content table .email-order-details td:first-child, #body_content table .email-order-details th:first-child { padding-<?php echo is_rtl() ? 'right' : 'left'; ?>: 0; } #body_content table .email-order-details td:last-child, #body_content table .email-order-details th:last-child { padding-<?php echo is_rtl() ? 'left' : 'right'; ?>: 0; } #body_content .email-order-details tbody tr:last-child td { border-bottom: 1px solid <?php echo esc_attr( $border_color ); ?>; padding-bottom: 24px; } #body_content .email-order-details tfoot tr:first-child td, #body_content .email-order-details tfoot tr:first-child th { padding-top: 24px; } #body_content .order-item-data td { border: 0 !important; padding: 0 !important; vertical-align: middle; } #body_content .email-order-details .order-totals td, #body_content .email-order-details .order-totals th { font-weight: normal; padding-bottom: 5px; padding-top: 5px; } #body_content .email-order-details .order-totals .includes_tax { display: block; } #body_content .email-order-details .order-totals-total th { font-weight: bold; } #body_content .email-order-details .order-totals-total td { font-weight: bold; font-size: 20px; } #body_content .email-order-details .order-totals-last td, #body_content .email-order-details .order-totals-last th { border-bottom: 1px solid <?php echo esc_attr( $border_color ); ?>; padding-bottom: 24px; } #body_content .email-order-details .order-customer-note td { border-bottom: 1px solid <?php echo esc_attr( $border_color ); ?>; padding-bottom: 24px; padding-top: 24px; } #body_content td ul.wc-item-meta { font-size: small; margin: 1em 0 0; padding: 0; list-style: none; } #body_content td ul.wc-item-meta li { margin: 0.5em 0 0; padding: 0; } #body_content td ul.wc-item-meta li p { margin: 0; } #body_content .email-order-details .wc-item-meta-label { clear: both; float: <?php echo is_rtl() ? 'right' : 'left'; ?>; font-weight: normal; margin-<?php echo is_rtl() ? 'left' : 'right'; ?>: .25em; } #body_content p { margin: 0 0 16px; } #body_content_inner { color: <?php echo esc_attr( $text_lighter_20 ); ?>; font-family: <?php echo $safe_font_family; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>; font-size: <?php echo $email_improvements_enabled ? '16px' : '14px'; ?>; line-height: 150%; text-align: <?php echo is_rtl() ? 'right' : 'left'; ?>; } .td { color: <?php echo esc_attr( $text_lighter_20 ); ?>; border: <?php echo $email_improvements_enabled ? '0' : '1px solid ' . esc_attr( $body_darker_10 ); ?>; vertical-align: middle; } .address { <?php if ( $email_improvements_enabled ) { ?> color: <?php echo esc_attr( $text ); ?>; font-style: normal; padding: 8px 0; <?php } else { ?> padding: 12px; color: <?php echo esc_attr( $text_lighter_20 ); ?>; border: 1px solid <?php echo esc_attr( $body_darker_10 ); ?>; <?php } ?> word-break: break-all; } <?php if ( $email_improvements_enabled ) : ?> #addresses td + td { padding-<?php echo is_rtl() ? 'right' : 'left'; ?>: 10px !important; } <?php endif; ?> .additional-fields { padding: 12px 12px 0; color: <?php echo esc_attr( $text_lighter_20 ); ?>; border: 1px solid <?php echo esc_attr( $body_darker_10 ); ?>; list-style: none outside; } .additional-fields li { margin: 0 0 12px 0; } .text, .address-title, .order-item-data { color: <?php echo esc_attr( $text ); ?>; font-family: <?php echo $safe_font_family; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>; } .link { color: <?php echo esc_attr( $link_color ); ?>; } #header_wrapper { padding: <?php echo $email_improvements_enabled ? '20px 32px 0' : '36px 48px'; ?>; display: block; } <?php if ( $header_alignment ) : ?> #header_wrapper h1 { text-align: <?php echo esc_attr( $header_alignment ); ?>; } <?php endif; ?> #template_footer #credit, #template_footer #credit a { color: <?php echo esc_attr( $footer_text ); ?>; } h1 { color: <?php echo esc_attr( $email_improvements_enabled ? $text : $base ); ?>; font-family: <?php echo $safe_font_family; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>; font-size: <?php echo $email_improvements_enabled ? '32px' : '30px'; ?>; font-weight: <?php echo $email_improvements_enabled ? 700 : 300; ?>; <?php if ( $email_improvements_enabled ) : ?> letter-spacing: -1px; <?php endif; ?> line-height: <?php echo $email_improvements_enabled ? '120%' : '150%'; ?>; margin: 0; text-align: <?php echo is_rtl() ? 'right' : 'left'; ?>; <?php if ( ! $email_improvements_enabled ) : ?> text-shadow: 0 1px 0 <?php echo esc_attr( $base_lighter_20 ); ?>; <?php endif; ?> } h2 { color: <?php echo esc_attr( $email_improvements_enabled ? $text : $base ); ?>; display: block; font-family: <?php echo $safe_font_family; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>; font-size: <?php echo $email_improvements_enabled ? '20px' : '18px'; ?>; font-weight: bold; line-height: <?php echo $email_improvements_enabled ? '160%' : '130%'; ?>; margin: 0 0 18px; text-align: <?php echo is_rtl() ? 'right' : 'left'; ?>; } h3 { color: <?php echo esc_attr( $email_improvements_enabled ? $text : $base ); ?>; display: block; font-family: <?php echo $safe_font_family; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>; font-size: 16px; font-weight: bold; line-height: <?php echo $email_improvements_enabled ? '160%' : '130%'; ?>; margin: 16px 0 8px; text-align: <?php echo is_rtl() ? 'right' : 'left'; ?>; } a { color: <?php echo esc_attr( $link_color ); ?>; font-weight: normal; text-decoration: underline; } img { border: none; display: inline-block; font-size: 14px; font-weight: bold; height: auto; outline: none; text-decoration: none; text-transform: capitalize; vertical-align: middle; margin-<?php echo is_rtl() ? 'left' : 'right'; ?>: <?php echo $email_improvements_enabled ? '24px' : '10px'; ?>; max-width: 100%; } h2.email-order-detail-heading span { color: <?php echo esc_attr( $footer_text ); ?>; display: block; font-size: 14px; font-weight: normal; } .font-family { font-family: <?php echo $safe_font_family; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>; } .text-align-left { text-align: <?php echo is_rtl() ? 'right' : 'left'; ?>; } .text-align-right { text-align: <?php echo is_rtl() ? 'left' : 'right'; ?>; } /** * Media queries are not supported by all email clients, however they do work on modern mobile * Gmail clients and can help us achieve better consistency there. */ @media screen and (max-width: 600px) { <?php if ( $email_improvements_enabled ) : ?> #template_header_image { padding: 16px 10px 0 !important; } #header_wrapper { padding: 16px 10px 0 !important; } #header_wrapper h1 { font-size: 24px !important; } #body_content_inner_cell { padding: 10px !important; } #body_content_inner { font-size: 12px !important; } .email-order-item-meta { font-size: 12px !important; } #body_content .email-order-details .order-totals-total td { font-size: 14px !important; } .email-order-detail-heading { font-size: 16px !important; line-height: 130% !important; } .email-additional-content { padding-top: 16px !important; } <?php else : ?> #header_wrapper { padding: 27px 36px !important; font-size: 24px; } #body_content table > tbody > tr > td { padding: 10px !important; } #body_content_inner { font-size: 10px !important; } <?php endif; ?> } <?php customer-failed-order.php 0000777 00000006523 15253050367 0011474 0 ustar 00 <?php /** * Customer failed order email * * This template can be overridden by copying it to yourtheme/woocommerce/emails/customer-failed-order.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails * @version 10.4.0 */ use Automattic\WooCommerce\Utilities\FeaturesUtil; if ( ! defined( 'ABSPATH' ) ) { exit; } $email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' ); /** * Hook for the woocommerce_email_header. * * @hooked WC_Emails::email_header() Output the email header * @since 3.7.0 */ do_action( 'woocommerce_email_header', $email_heading, $email ); ?> <?php echo $email_improvements_enabled ? '<div class="email-introduction">' : ''; ?> <p> <?php if ( ! empty( $order->get_billing_first_name() ) ) { /* translators: %s: Customer first name */ printf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_billing_first_name() ) ); } else { printf( esc_html__( 'Hi,', 'woocommerce' ) ); } ?> </p> <p><?php esc_html_e( "Unfortunately, we couldn't complete your order due to an issue with your payment method.", 'woocommerce' ); ?></p> <?php /* translators: %s: Site title */ ?> <p><?php printf( esc_html__( "If you'd like to continue with your purchase, please return to %s and try a different method of payment.", 'woocommerce' ), esc_html( $blogname ) ); ?></p> <p><?php esc_html_e( 'Your order details are as follows:', 'woocommerce' ); ?></p> <?php echo $email_improvements_enabled ? '</div>' : ''; ?> <?php /** * Hook for the woocommerce_email_order_details. * * @hooked WC_Emails::order_details() Shows the order details table. * @hooked WC_Structured_Data::generate_order_data() Generates structured data. * @hooked WC_Structured_Data::output_structured_data() Outputs structured data. * @since 2.5.0 */ do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email ); /** * Hook for the woocommerce_email_order_meta. * * @hooked WC_Emails::order_meta() Shows order meta data. * @since 1.0.0 */ do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email ); /** * Hook for woocommerce_email_customer_details. * * @hooked WC_Emails::customer_details() Shows customer details * @hooked WC_Emails::email_address() Shows email address * @since 1.0.0 */ do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email ); /** * Show user-defined additional content - this is set in each email's settings. */ if ( $additional_content ) { echo $email_improvements_enabled ? '<table border="0" cellpadding="0" cellspacing="0" width="100%" role="presentation"><tr><td class="email-additional-content">' : ''; echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) ); echo $email_improvements_enabled ? '</td></tr></table>' : ''; } /** * Hook for the woocommerce_email_footer. * * @hooked WC_Emails::email_footer() Output the email footer * @since 3.7.0 */ do_action( 'woocommerce_email_footer', $email ); email-addresses.php 0000777 00000007170 15253050367 0010341 0 ustar 00 <?php /** * Email Addresses * * This template can be overridden by copying it to yourtheme/woocommerce/emails/email-addresses.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails * @version 10.4.0 */ use Automattic\WooCommerce\Utilities\FeaturesUtil; if ( ! defined( 'ABSPATH' ) ) { exit; } $address = $order->get_formatted_billing_address(); $shipping = $order->get_formatted_shipping_address(); $email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' ); ?><table id="addresses" cellspacing="0" cellpadding="0" style="width: 100%; vertical-align: top; margin-bottom: <?php echo $email_improvements_enabled ? '0' : '40px'; ?>; padding:0;" border="0" role="presentation"> <tr> <td class="font-family text-align-left" style="border:0; padding:0;" valign="top" width="50%"> <?php if ( $email_improvements_enabled ) { ?> <b class="address-title"><?php esc_html_e( 'Billing address', 'woocommerce' ); ?></b> <?php } else { ?> <h2><?php esc_html_e( 'Billing address', 'woocommerce' ); ?></h2> <?php } ?> <address class="address"> <?php echo wp_kses_post( $address ? $address : esc_html__( 'N/A', 'woocommerce' ) ); ?> <?php if ( $order->get_billing_phone() ) : ?> <br/><?php echo wc_make_phone_clickable( $order->get_billing_phone() ); ?> <?php endif; ?> <?php if ( $order->get_billing_email() ) : ?> <br/><?php echo esc_html( $order->get_billing_email() ); ?> <?php endif; ?> <?php /** * Fires after the core address fields in emails. * * @since 8.6.0 * * @param string $type Address type. Either 'billing' or 'shipping'. * @param WC_Order $order Order instance. * @param bool $sent_to_admin If this email is being sent to the admin or not. * @param bool $plain_text If this email is plain text or not. */ do_action( 'woocommerce_email_customer_address_section', 'billing', $order, $sent_to_admin, false ); ?> </address> </td> <?php if ( ! wc_ship_to_billing_address_only() && $order->needs_shipping_address() && $shipping ) : ?> <td class="font-family text-align-left" style="padding:0;" valign="top" width="50%"> <?php if ( $email_improvements_enabled ) { ?> <b class="address-title"><?php esc_html_e( 'Shipping address', 'woocommerce' ); ?></b> <?php } else { ?> <h2><?php esc_html_e( 'Shipping address', 'woocommerce' ); ?></h2> <?php } ?> <address class="address"> <?php echo wp_kses_post( $shipping ); ?> <?php if ( $order->get_shipping_phone() ) : ?> <br /><?php echo wc_make_phone_clickable( $order->get_shipping_phone() ); ?> <?php endif; ?> <?php /** * Fires after the core address fields in emails. * * @since 8.6.0 * * @param string $type Address type. Either 'billing' or 'shipping'. * @param WC_Order $order Order instance. * @param bool $sent_to_admin If this email is being sent to the admin or not. * @param bool $plain_text If this email is plain text or not. */ do_action( 'woocommerce_email_customer_address_section', 'shipping', $order, $sent_to_admin, false ); ?> </address> </td> <?php endif; ?> </tr> </table> <?php echo $email_improvements_enabled ? '<br>' : ''; ?> email-downloads.php 0000777 00000006750 15253050367 0010361 0 ustar 00 <?php /** * Email Downloads. * * This template can be overridden by copying it to yourtheme/woocommerce/emails/email-downloads.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates * @version 10.4.0 */ use Automattic\WooCommerce\Utilities\FeaturesUtil; defined( 'ABSPATH' ) || exit; $email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' ); ?><h2 class="woocommerce-order-downloads__title<?php echo $email_improvements_enabled ? ' email-order-detail-heading' : ''; ?>"><?php esc_html_e( 'Downloads', 'woocommerce' ); ?></h2> <table class="td font-family<?php echo $email_improvements_enabled ? ' email-order-details' : ''; ?>" cellspacing="0" cellpadding="<?php echo $email_improvements_enabled ? '0' : '6'; ?>" style="width: 100%; margin-bottom: 40px;" border="<?php echo $email_improvements_enabled ? '0' : '1'; ?>" > <thead> <tr> <?php foreach ( $columns as $column_id => $column_name ) : ?> <th class="td <?php echo $email_improvements_enabled && array_key_last( $columns ) === $column_id ? 'text-align-right' : 'text-align-left'; ?>" scope="col"> <?php echo esc_html( $column_name ); ?> </th> <?php endforeach; ?> </tr> </thead> <?php foreach ( $downloads as $download ) : ?> <tr> <?php foreach ( $columns as $column_id => $column_name ) : ?> <?php $column_alignment_class = $email_improvements_enabled && array_key_last( $columns ) === $column_id ? 'text-align-right' : 'text-align-left'; if ( 'download-product' === $column_id ) : ?> <th class="td <?php echo esc_attr( $column_alignment_class ); ?>" scope="row"> <?php else : ?> <td class="td <?php echo esc_attr( $column_alignment_class ); ?>"> <?php endif; ?> <?php if ( has_action( 'woocommerce_email_downloads_column_' . $column_id ) ) { do_action( 'woocommerce_email_downloads_column_' . $column_id, $download, $plain_text ); } else { switch ( $column_id ) { case 'download-product': ?> <a href="<?php echo esc_url( get_permalink( $download['product_id'] ) ); ?>"><?php echo wp_kses_post( $download['product_name'] ); ?></a> <?php break; case 'download-file': ?> <a href="<?php echo esc_url( $download['download_url'] ); ?>" class="woocommerce-MyAccount-downloads-file button alt"><?php echo esc_html( $download['download_name'] ); ?></a> <?php break; case 'download-expires': if ( ! empty( $download['access_expires'] ) ) { ?> <time datetime="<?php echo esc_attr( date( 'Y-m-d', strtotime( $download['access_expires'] ) ) ); ?>" title="<?php echo esc_attr( strtotime( $download['access_expires'] ) ); ?>"><?php echo esc_html( date_i18n( get_option( 'date_format' ), strtotime( $download['access_expires'] ) ) ); ?></time> <?php } else { esc_html_e( 'Never', 'woocommerce' ); } break; } } ?> <?php if ( 'download-product' === $column_id ) : ?> </th> <?php else : ?> </td> <?php endif; ?> <?php endforeach; ?> </tr> <?php endforeach; ?> </table> customer-fulfillment-created.php 0000777 00000006451 15253050367 0013065 0 ustar 00 <?php /** * Customer fulfillment created email * * This template can be overridden by copying it to yourtheme/woocommerce/emails/customer-fulfillment-created.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails\HTML * @version 10.4.0 */ defined( 'ABSPATH' ) || exit; /** * Hook for the woocommerce_email_header. * * @param string $email_heading The email heading. * @param WC_Email $email The email object. * @since 2.5.0 * * @hooked WC_Emails::email_header() Output the email header */ do_action( 'woocommerce_email_header', $email_heading, $email ); ?> <div class="email-introduction"> <p><?php echo esc_html__( 'Woo! Some items you purchased are being fulfilled. You can use the below information to track your shipment:', 'woocommerce' ); ?></p> </div> <?php /** * Hook for the woocommerce_email_fulfillment_details. * * @since 10.1.0 * @param WC_Order $order The order object. * @param Fulfillment $fulfillment The fulfillment object. * @param bool $sent_to_admin Whether the email is sent to admin. * @param bool $plain_text Whether the email is plain text. * @param WC_Email $email The email object. * * @hooked WC_Emails::fulfillment_details() Shows the fulfillment details. */ do_action( 'woocommerce_email_fulfillment_details', $order, $fulfillment, $sent_to_admin, $plain_text, $email ); /** * Hook for the woocommerce_email_fulfillment_meta. * * @param WC_Order $order The order object. * @param Fulfillment $fulfillment The fulfillment object. * @param bool $sent_to_admin Whether the email is sent to admin. * @param bool $plain_text Whether the email is plain text. * @param WC_Email $email The email object. * @since 10.1.0 * * @hooked WC_Emails::order_meta() Shows fulfillment meta data. */ do_action( 'woocommerce_email_fulfillment_meta', $order, $fulfillment, $sent_to_admin, $plain_text, $email ); /** * Hook for woocommerce_email_customer_details. * * @param WC_Order $order The order object. * @param bool $sent_to_admin Whether the email is sent to admin. * @param bool $plain_text Whether the email is plain text. * @param WC_Email $email The email object. * @since 2.5.0 * * @hooked WC_Emails::customer_details() Shows customer details * @hooked WC_Emails::email_address() Shows email address */ do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email ); /** * Show user-defined additional content - this is set in each email's settings. */ if ( $additional_content ) { echo '<table border="0" cellpadding="0" cellspacing="0" width="100%" role="presentation"><tr><td class="email-additional-content">'; echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) ); echo '</td></tr></table>'; } /** * Hook for the woocommerce_email_footer. * * @param WC_Email $email The email object. * @since 2.5.0 * * @hooked WC_Emails::email_footer() Output the email footer */ do_action( 'woocommerce_email_footer', $email ); block/customer-new-account.php 0000777 00000005321 15253050367 0012447 0 ustar 00 <?php /** * Customer new account email (initial block content). * * This template can be overridden by editing it in the WooCommerce email editor. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails\Block * @version 10.2.0 */ use Automattic\WooCommerce\Internal\EmailEditor\BlockEmailRenderer; defined( 'ABSPATH' ) || exit; // phpcs:disable Squiz.PHP.EmbeddedPhp.ContentBeforeOpen -- removed to prevent empty new lines. // phpcs:disable Squiz.PHP.EmbeddedPhp.ContentAfterEnd -- removed to prevent empty new lines. ?> <!-- wp:heading --> <h2 class="wp-block-heading"><?php /* translators: %s: Site title*/ printf( esc_html__( 'Welcome to %s', 'woocommerce' ), '<!--[woocommerce/site-title]-->' ); ?></h2> <!-- /wp:heading --> <!-- wp:paragraph --> <p><?php /* translators: %s: Customer first name */ printf( esc_html__( 'Hi %s,', 'woocommerce' ), '<!--[woocommerce/customer-first-name]-->' ); ?></p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p><?php /* translators: %s: Site title */ printf( esc_html__( 'Thanks for creating an account on %s. Here’s a copy of your user details.', 'woocommerce' ), '<!--[woocommerce/site-title]-->' ); ?></p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p><?php /* translators: %s: Username */ echo wp_kses( sprintf( __( 'Username: <b>%s</b>', 'woocommerce' ), '<!--[woocommerce/customer-username]-->' ), array( 'b' => array() ) ); ?></p> <!-- /wp:paragraph --> <!-- wp:woocommerce/email-content {"lock":{"move":false,"remove":true}} --> <div class="wp-block-woocommerce-email-content"> <?php echo esc_html( BlockEmailRenderer::WOO_EMAIL_CONTENT_PLACEHOLDER ); ?> </div> <!-- /wp:woocommerce/email-content --> <!-- wp:paragraph --> <p><?php echo esc_html__( 'You can access your account area to view orders, change your password, and more via the link below:', 'woocommerce' ); ?></p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p><?php $link_template = '<a data-link-href="%1$s" contenteditable="false" style="text-decoration: underline;">%2$s</a>'; printf( '%s', wp_kses_post( sprintf( $link_template, esc_attr( '[woocommerce/my-account-url]' ), esc_html__( 'My account', 'woocommerce' ) ) ) ); ?></p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p> <?php echo esc_html__( 'We look forward to seeing you soon.', 'woocommerce' ); ?> </p> <!-- /wp:paragraph --> block/customer-processing-order.php 0000777 00000004133 15253050367 0013511 0 ustar 00 <?php /** * Customer processing order email (initial block version) * * This template can be overridden by editing it in the WooCommerce email editor. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails\Block * @version 10.5.0 */ use Automattic\WooCommerce\Internal\EmailEditor\BlockEmailRenderer; defined( 'ABSPATH' ) || exit; // phpcs:disable Squiz.PHP.EmbeddedPhp.ContentBeforeOpen -- removed to prevent empty new lines. // phpcs:disable Squiz.PHP.EmbeddedPhp.ContentAfterEnd -- removed to prevent empty new lines. ?> <!-- wp:heading --> <h2 class="wp-block-heading"> <?php echo esc_html__( 'Thank you for your order', 'woocommerce' ); ?> </h2> <!-- /wp:heading --> <!-- wp:paragraph --> <p><?php /* translators: %s: Customer first name */ printf( esc_html__( 'Hi %s,', 'woocommerce' ), '<!--[woocommerce/customer-first-name]-->' ); ?></p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p> <?php echo esc_html__( 'Just to let you know — we’ve received your order, and it is now being processed.', 'woocommerce' ); ?> </p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p> <?php echo esc_html__( 'Here’s a reminder of what you’ve ordered:', 'woocommerce' ); ?> </p> <!-- /wp:paragraph --> <!-- wp:woocommerce/email-content {"lock":{"move":false,"remove":true}} --> <div class="wp-block-woocommerce-email-content"> <?php echo esc_html( BlockEmailRenderer::WOO_EMAIL_CONTENT_PLACEHOLDER ); ?> </div> <!-- /wp:woocommerce/email-content --> <!-- wp:paragraph --> <p><?php /* translators: %s: Store admin email */ printf( esc_html__( 'Thanks again! If you need any help with your order, please contact us at %s,', 'woocommerce' ), '<!--[woocommerce/store-email]-->' ); ?></p> <!-- /wp:paragraph --> block/admin-new-order.php 0000777 00000003416 15253050367 0011360 0 ustar 00 <?php /** * Admin new order email (initial block content) * * This template can be overridden by editing it in the WooCommerce email editor. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails\Block * @version 10.2.0 */ use Automattic\WooCommerce\Internal\EmailEditor\BlockEmailRenderer; defined( 'ABSPATH' ) || exit; // phpcs:disable Squiz.PHP.EmbeddedPhp.ContentBeforeOpen -- removed to prevent empty new lines. // phpcs:disable Squiz.PHP.EmbeddedPhp.ContentAfterEnd -- removed to prevent empty new lines. ?> <!-- wp:heading --> <h2 class="wp-block-heading"><?php /* translators: %s: order number */ printf( esc_html__( 'New order: #%s,', 'woocommerce' ), '<!--[woocommerce/order-number]-->' ); ?></h2> <!-- /wp:heading --> <!-- wp:paragraph --> <p><?php /* translators: %s: Customer full name */ printf( esc_html__( 'You’ve received a new order from %s', 'woocommerce' ), '<!--[woocommerce/customer-full-name]-->' ); ?></p> <!-- /wp:paragraph --> <!-- wp:woocommerce/email-content {"lock":{"move":false,"remove":true}} --> <div class="wp-block-woocommerce-email-content"> <?php echo esc_html( BlockEmailRenderer::WOO_EMAIL_CONTENT_PLACEHOLDER ); ?> </div> <!-- /wp:woocommerce/email-content --> <!-- wp:paragraph {"align":"center"} --> <p class="has-text-align-center"> <?php echo esc_html__( 'Congratulations on the sale!', 'woocommerce' ); ?> </p> <!-- /wp:paragraph --> block/customer-reset-password.php 0000777 00000004466 15253050367 0013217 0 ustar 00 <?php /** * Customer Reset Password email (initial block version) * * This template can be overridden by editing it in the WooCommerce email editor. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails\Block * @version 10.5.0 */ use Automattic\WooCommerce\Internal\EmailEditor\BlockEmailRenderer; defined( 'ABSPATH' ) || exit; // phpcs:disable Squiz.PHP.EmbeddedPhp.ContentBeforeOpen -- removed to prevent empty new lines. // phpcs:disable Squiz.PHP.EmbeddedPhp.ContentAfterEnd -- removed to prevent empty new lines. ?> <!-- wp:heading --> <h2 class="wp-block-heading"> <?php echo esc_html__( 'Reset your password', 'woocommerce' ); ?> </h2> <!-- /wp:heading --> <!-- wp:paragraph --> <p><?php /* translators: %s: Customer username */ printf( esc_html__( 'Hi %s,', 'woocommerce' ), '<!--[woocommerce/customer-username]-->' ); ?></p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p><?php /* translators: %s: Store name */ printf( esc_html__( 'Someone has requested a new password for the following account on %s:', 'woocommerce' ), '<!--[woocommerce/site-title]-->' ); ?></p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p><?php /* translators: %s: Username */ echo wp_kses( sprintf( __( 'Username: <b>%s</b>', 'woocommerce' ), '<!--[woocommerce/customer-username]-->' ), array( 'b' => array() ) ); ?></p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p><?php echo esc_html__( 'If you didn’t make this request, just ignore this email. If you’d like to proceed, reset your password via the link below:', 'woocommerce' ); ?></p> <!-- /wp:paragraph --> <!-- wp:woocommerce/email-content {"lock":{"move":false,"remove":true}} --> <div class="wp-block-woocommerce-email-content"> <?php echo esc_html( BlockEmailRenderer::WOO_EMAIL_CONTENT_PLACEHOLDER ); ?> </div> <!-- /wp:woocommerce/email-content --> <!-- wp:paragraph --> <p> <?php echo esc_html__( 'Thanks for reading.', 'woocommerce' ); ?> </p> <!-- /wp:paragraph --> block/customer-pos-refunded-order.php 0000777 00000003210 15253050367 0013723 0 ustar 00 <?php /** * Customer POS refunded order email (initial block version) * * This template can be overridden by editing it in the WooCommerce email editor. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails\Block * @version 10.5.0 */ use Automattic\WooCommerce\Internal\EmailEditor\BlockEmailRenderer; defined( 'ABSPATH' ) || exit; // phpcs:disable Squiz.PHP.EmbeddedPhp.ContentBeforeOpen -- removed to prevent empty new lines. // phpcs:disable Squiz.PHP.EmbeddedPhp.ContentAfterEnd -- removed to prevent empty new lines. ?> <!-- wp:heading --> <h2 class="wp-block-heading"><?php /* translators: %s: Order number */ printf( esc_html__( 'Order refunded: %s', 'woocommerce' ), '<!--[woocommerce/order-number]-->' ); ?></h2> <!-- /wp:heading --> <!-- wp:paragraph --> <p> <?php echo esc_html__( 'Hi there,', 'woocommerce' ); ?> </p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p> <?php echo esc_html__( 'Here’s a reminder of what you’ve bought:', 'woocommerce' ); ?> </p> <!-- /wp:paragraph --> <!-- wp:woocommerce/email-content {"lock":{"move":false,"remove":true}} --> <div class="wp-block-woocommerce-email-content"> <?php echo esc_html( BlockEmailRenderer::WOO_EMAIL_CONTENT_PLACEHOLDER ); ?> </div> <!-- /wp:woocommerce/email-content --> block/admin-failed-order.php 0000777 00000003744 15253050367 0012017 0 ustar 00 <?php /** * Admin failed order email (initial block content) * * This template can be overridden by editing it in the WooCommerce email editor. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails\Block * @version 10.2.0 */ use Automattic\WooCommerce\Internal\EmailEditor\BlockEmailRenderer; defined( 'ABSPATH' ) || exit; // phpcs:disable Squiz.PHP.EmbeddedPhp.ContentBeforeOpen -- removed to prevent empty new lines. // phpcs:disable Squiz.PHP.EmbeddedPhp.ContentAfterEnd -- removed to prevent empty new lines. ?> <!-- wp:heading --> <h2 class="wp-block-heading"><?php /* translators: %s: order number */ printf( esc_html__( 'Order failed: #%s,', 'woocommerce' ), '<!--[woocommerce/order-number]-->' ); ?></h2> <!-- /wp:heading --> <!-- wp:paragraph --> <p><?php /* translators: %1$s: Order number. %2$s: Customer full name. */ $text = __( 'Unfortunately, the payment for order #%1$s from %2$s has failed. The order was as follows:', 'woocommerce' ); printf( esc_html( $text ), '<!--[woocommerce/order-number]-->', '<!--[woocommerce/customer-full-name]-->' ); ?></p> <!-- /wp:paragraph --> <!-- wp:woocommerce/email-content {"lock":{"move":false,"remove":true}} --> <div class="wp-block-woocommerce-email-content"> <?php echo esc_html( BlockEmailRenderer::WOO_EMAIL_CONTENT_PLACEHOLDER ); ?> </div> <!-- /wp:woocommerce/email-content --> <!-- wp:paragraph --> <p><?php echo wp_kses_post( __( 'We hope they’ll be back soon! Read more about <a href="https://woocommerce.com/document/managing-orders/">troubleshooting failed payments</a>.', 'woocommerce' ) ); ?></p> <!-- /wp:paragraph --> block/customer-refunded-order.php 0000777 00000004244 15253050367 0013134 0 ustar 00 <?php /** * Customer refunded order email (initial block version) * * This template can be overridden by editing it in the WooCommerce email editor. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails\Block * @version 10.5.0 */ use Automattic\WooCommerce\Internal\EmailEditor\BlockEmailRenderer; defined( 'ABSPATH' ) || exit; // phpcs:disable Squiz.PHP.EmbeddedPhp.ContentBeforeOpen -- removed to prevent empty new lines. // phpcs:disable Squiz.PHP.EmbeddedPhp.ContentAfterEnd -- removed to prevent empty new lines. ?> <!-- wp:heading --> <h2 class="wp-block-heading"><?php /* translators: %s: Order number */ printf( esc_html__( 'Order refunded: %s', 'woocommerce' ), '<!--[woocommerce/order-number]-->' ); ?></h2> <!-- /wp:heading --> <!-- wp:paragraph --> <p><?php /* translators: %s: Customer first name */ printf( esc_html__( 'Hi %s,', 'woocommerce' ), '<!--[woocommerce/customer-first-name]-->' ); ?></p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p><?php /* translators: %s: Site title */ printf( esc_html__( 'Your order from %s has been refunded.', 'woocommerce' ), '<!--[woocommerce/site-title]-->' ); ?></p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p> <?php echo esc_html__( 'Here’s a reminder of what you’ve ordered:', 'woocommerce' ); ?> </p> <!-- /wp:paragraph --> <!-- wp:woocommerce/email-content {"lock":{"move":false,"remove":true}} --> <div class="wp-block-woocommerce-email-content"> <?php echo esc_html( BlockEmailRenderer::WOO_EMAIL_CONTENT_PLACEHOLDER ); ?> </div> <!-- /wp:woocommerce/email-content --> <!-- wp:paragraph --> <p><?php /* translators: %s: Store admin email */ printf( esc_html__( 'If you need any help with your order, please contact us at %s', 'woocommerce' ), '<!--[woocommerce/store-email]-->' ); ?></p> <!-- /wp:paragraph --> block/customer-cancelled-order.php 0000777 00000003202 15253050367 0013243 0 ustar 00 <?php /** * Customer cancelled order email - block template. * * This template can be overridden by copying it to yourtheme/woocommerce/emails/block/customer-cancelled-order.php. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails\Block * @version 10.2.0 */ use Automattic\WooCommerce\Internal\EmailEditor\BlockEmailRenderer; defined( 'ABSPATH' ) || exit; // phpcs:disable Squiz.PHP.EmbeddedPhp.ContentBeforeOpen -- removed to prevent empty new lines. // phpcs:disable Squiz.PHP.EmbeddedPhp.ContentAfterEnd -- removed to prevent empty new lines. ?> <!-- wp:heading --> <h2 class="wp-block-heading"><?php /* translators: %s: Order number */ printf( esc_html__( 'Order Cancelled: #%s', 'woocommerce' ), '<!--[woocommerce/order-number]-->' ); ?></h2> <!-- /wp:heading --> <!-- wp:paragraph --> <p><?php /* translators: %s: Customer first name */ printf( esc_html__( 'Hi %s,', 'woocommerce' ), '<!--[woocommerce/customer-first-name]-->' ); ?></p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p><?php /* translators: %s: Order number */ printf( esc_html__( 'Your order #%s has been cancelled.', 'woocommerce' ), '<!--[woocommerce/order-number]-->' ); ?></p> <!-- /wp:paragraph --> <!-- wp:woocommerce/email-content {"lock":{"move":false,"remove":true}} --> <div class="wp-block-woocommerce-email-content"> <?php echo esc_html( BlockEmailRenderer::WOO_EMAIL_CONTENT_PLACEHOLDER ); ?> </div> <!-- /wp:woocommerce/email-content --> <!-- wp:paragraph --> <p><?php /* translators: %s: Store admin email */ printf( esc_html__( 'We hope to see you again soon.', 'woocommerce' ) ); ?></p> <!-- /wp:paragraph --> block/customer-note.php 0000777 00000004607 15253050367 0011177 0 ustar 00 <?php /** * Customer note email (initial block content) * * This template can be overridden by editing it in the WooCommerce email editor. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails\Block * @version 10.2.0 */ use Automattic\WooCommerce\Internal\EmailEditor\BlockEmailRenderer; defined( 'ABSPATH' ) || exit; // phpcs:disable Squiz.PHP.EmbeddedPhp.ContentBeforeOpen -- removed to prevent empty new lines. // phpcs:disable Squiz.PHP.EmbeddedPhp.ContentAfterEnd -- removed to prevent empty new lines. ?> <!-- wp:heading --> <h2 class="wp-block-heading"> <?php echo esc_html__( 'A note has been added to your order', 'woocommerce' ); ?> </h2> <!-- /wp:heading --> <!-- wp:paragraph --> <p><?php /* translators: %s: Customer first name */ printf( esc_html__( 'Hi %s,', 'woocommerce' ), '<!--[woocommerce/customer-first-name]-->' ); ?></p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p> <?php echo esc_html__( 'The following note has been added to your order:', 'woocommerce' ); ?> </p> <!-- /wp:paragraph --> <!-- wp:quote {"lock":{"move":false,"remove":true}} --> <blockquote class="wp-block-quote"> <!-- wp:paragraph {"lock":{"move":false,"remove":true}} --> <p> <?php echo '| <!--[woocommerce/admin-order-note]--> |'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> </p> <!-- /wp:paragraph --> </blockquote> <!-- /wp:quote --> <!-- wp:paragraph --> <p> <?php echo esc_html__( 'As a reminder, here are your order details:', 'woocommerce' ); ?> </p> <!-- /wp:paragraph --> <!-- wp:woocommerce/email-content {"lock":{"move":false,"remove":true}} --> <div class="wp-block-woocommerce-email-content"> <?php echo esc_html( BlockEmailRenderer::WOO_EMAIL_CONTENT_PLACEHOLDER ); ?> </div> <!-- /wp:woocommerce/email-content --> <!-- wp:paragraph --> <p><?php /* translators: %s: Store admin email */ printf( esc_html__( 'Thanks again! If you need any help with your order, please contact us at %s,', 'woocommerce' ), '<!--[woocommerce/store-email]-->' ); ?></p> <!-- /wp:paragraph --> block/admin-cancelled-order.php 0000777 00000003542 15253050367 0012501 0 ustar 00 <?php /** * Admin cancelled order email (initial block content) * * This template can be overridden by editing it in the WooCommerce email editor. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails\Block * @version 10.4.0 */ use Automattic\WooCommerce\Internal\EmailEditor\BlockEmailRenderer; defined( 'ABSPATH' ) || exit; // phpcs:disable Squiz.PHP.EmbeddedPhp.ContentBeforeOpen -- removed to prevent empty new lines. // phpcs:disable Squiz.PHP.EmbeddedPhp.ContentAfterEnd -- removed to prevent empty new lines. ?> <!-- wp:heading --> <h2 class="wp-block-heading"><?php /* translators: %s: order number */ printf( esc_html__( 'Canceled order: #%s,', 'woocommerce' ), '<!--[woocommerce/order-number]-->' ); ?></h2> <!-- /wp:heading --> <!-- wp:paragraph --> <p><?php /* translators: %1$s: Order number. %2$s: Customer full name */ $text = __( 'We’re getting in touch to let you know that order #%1$s from %2$s has been cancelled.', 'woocommerce' ); printf( esc_html( $text ), '<!--[woocommerce/order-number]-->', '<!--[woocommerce/customer-full-name]-->' ); ?></p> <!-- /wp:paragraph --> <!-- wp:woocommerce/email-content {"lock":{"move":false,"remove":true}} --> <div class="wp-block-woocommerce-email-content"> <?php echo esc_html( BlockEmailRenderer::WOO_EMAIL_CONTENT_PLACEHOLDER ); ?> </div> <!-- /wp:woocommerce/email-content --> <!-- wp:paragraph --> <p> <?php echo esc_html__( 'Thanks for reading.', 'woocommerce' ); ?> </p> <!-- /wp:paragraph --> block/customer-pos-completed-order.php 0000777 00000002360 15253050367 0014110 0 ustar 00 <?php /** * Customer POS completed order email (initial block content) * * This template can be overridden by editing it in the WooCommerce email editor. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails\Block * @version 10.2.0 */ use Automattic\WooCommerce\Internal\EmailEditor\BlockEmailRenderer; defined( 'ABSPATH' ) || exit; ?> <!-- wp:paragraph --> <p> <?php echo esc_html__( 'Hi there,', 'woocommerce' ); ?> </p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p> <?php echo esc_html__( 'Here’s a reminder of what you’ve bought:', 'woocommerce' ); ?> </p> <!-- /wp:paragraph --> <!-- wp:woocommerce/email-content {"lock":{"move":false,"remove":true}} --> <div class="wp-block-woocommerce-email-content"> <?php echo esc_html( BlockEmailRenderer::WOO_EMAIL_CONTENT_PLACEHOLDER ); ?> </div> <!-- /wp:woocommerce/email-content --> block/general-block-content-for-fulfillment-emails.php 0000777 00000004320 15253050367 0017113 0 ustar 00 <?php /** * General block content for fulfillment emails * * Note: This template is only used in the fulfillment emails. * * Used to render information for the email editor WooCommerce content block (BlockEmailRenderer::WOO_EMAIL_CONTENT_PLACEHOLDER). * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails\Block * @version 10.5.0 */ defined( 'ABSPATH' ) || exit; // phpcs:disable Squiz.PHP.EmbeddedPhp.ContentBeforeOpen -- removed to prevent empty new lines. // phpcs:disable Squiz.PHP.EmbeddedPhp.ContentAfterEnd -- removed to prevent empty new lines. if ( ! isset( $order, $fulfillment ) ) { return; } /** * Hook for the woocommerce_email_fulfillment_details. * * @since 10.1.0 * @param WC_Order $order The order object. * @param Fulfillment $fulfillment The fulfillment object. * @param bool $sent_to_admin Whether the email is sent to admin. * @param bool $plain_text Whether the email is plain text. * @param WC_Email $email The email object. * * @hooked WC_Emails::fulfillment_details() Shows the fulfillment details. */ do_action( 'woocommerce_email_fulfillment_details', $order, $fulfillment, $sent_to_admin, $plain_text, $email ); /** * Hook for the woocommerce_email_fulfillment_meta. * * @param WC_Order $order The order object. * @param Fulfillment $fulfillment The fulfillment object. * @param bool $sent_to_admin Whether the email is sent to admin. * @param bool $plain_text Whether the email is plain text. * @param WC_Email $email The email object. * @since 10.1.0 * * @hooked WC_Emails::order_meta() Shows fulfillment meta data. */ do_action( 'woocommerce_email_fulfillment_meta', $order, $fulfillment, $sent_to_admin, $plain_text, $email ); /** * Hook for woocommerce_email_customer_details. * * @param WC_Order $order The order object. * @param bool $sent_to_admin Whether the email is sent to admin. * @param bool $plain_text Whether the email is plain text. * @param WC_Email $email The email object. * @since 2.5.0 * * @hooked WC_Emails::customer_details() Shows customer details * @hooked WC_Emails::email_address() Shows email address */ do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email ); block/customer-invoice.php 0000777 00000003514 15253050367 0011662 0 ustar 00 <?php /** * Customer invoice email (initial block content) * * This template can be overridden by editing it in the WooCommerce email editor. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails\Block * @version 10.2.0 */ use Automattic\WooCommerce\Internal\EmailEditor\BlockEmailRenderer; defined( 'ABSPATH' ) || exit; // phpcs:disable Squiz.PHP.EmbeddedPhp.ContentBeforeOpen -- removed to prevent empty new lines. // phpcs:disable Squiz.PHP.EmbeddedPhp.ContentAfterEnd -- removed to prevent empty new lines. ?> <!-- wp:heading --> <h2 class="wp-block-heading"><?php /* translators: %s: order number */ printf( esc_html__( 'Details for order #%s,', 'woocommerce' ), '<!--[woocommerce/order-number]-->' ); ?></h2> <!-- /wp:heading --> <!-- wp:paragraph --> <p><?php /* translators: %s: Customer first name */ printf( esc_html__( 'Hi %s,', 'woocommerce' ), '<!--[woocommerce/customer-first-name]-->' ); ?></p> <!-- /wp:paragraph --> <!-- wp:woocommerce/email-content {"lock":{"move":false,"remove":true}} --> <div class="wp-block-woocommerce-email-content"> <?php echo esc_html( BlockEmailRenderer::WOO_EMAIL_CONTENT_PLACEHOLDER ); ?> </div> <!-- /wp:woocommerce/email-content --> <!-- wp:paragraph --> <p><?php /* translators: %s: Store admin email */ printf( esc_html__( 'Thanks again! If you need any help with your order, please contact us at %s.', 'woocommerce' ), '<!--[woocommerce/store-email]-->' ); ?></p> <!-- /wp:paragraph --> block/customer-fulfillment-created.php 0000777 00000003317 15253050367 0014155 0 ustar 00 <?php /** * Customer fulfillment created email (initial block version) * * This template can be overridden by editing it in the WooCommerce email editor. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails\Block * @version 10.5.0 */ use Automattic\WooCommerce\Internal\EmailEditor\BlockEmailRenderer; defined( 'ABSPATH' ) || exit; // phpcs:disable Squiz.PHP.EmbeddedPhp.ContentBeforeOpen -- removed to prevent empty new lines. // phpcs:disable Squiz.PHP.EmbeddedPhp.ContentAfterEnd -- removed to prevent empty new lines. ?> <!-- wp:heading --> <h2 class="wp-block-heading"> <?php echo esc_html__( 'Your item is on the way!', 'woocommerce' ); ?> </h2> <!-- /wp:heading --> <!-- wp:paragraph --> <p><?php echo esc_html__( 'Woo! Some items you purchased are being fulfilled. You can use the below information to track your shipment:', 'woocommerce' ); ?></p> <!-- /wp:paragraph --> <!-- wp:woocommerce/email-content {"lock":{"move":false,"remove":true}} --> <div class="wp-block-woocommerce-email-content"> <?php echo esc_html( BlockEmailRenderer::WOO_EMAIL_CONTENT_PLACEHOLDER ); ?> </div> <!-- /wp:woocommerce/email-content --> <!-- wp:paragraph --> <p><?php echo esc_html__( 'Please note that couriers may need some time to provide the latest shipping information.', 'woocommerce' ); ?></p> <!-- /wp:paragraph --> block/customer-failed-order.php 0000777 00000004536 15253050367 0012570 0 ustar 00 <?php /** * Customer failed order email (initial block content) * * This template can be overridden by editing it in the WooCommerce email editor. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails\Block * @version 10.2.0 */ use Automattic\WooCommerce\Internal\EmailEditor\BlockEmailRenderer; defined( 'ABSPATH' ) || exit; // phpcs:disable Squiz.PHP.EmbeddedPhp.ContentBeforeOpen -- removed to prevent empty new lines. // phpcs:disable Squiz.PHP.EmbeddedPhp.ContentAfterEnd -- removed to prevent empty new lines. ?> <!-- wp:heading --> <h2 class="wp-block-heading"> <?php echo esc_html__( 'Sorry, your order was unsuccessful', 'woocommerce' ); ?> </h2> <!-- /wp:heading --> <!-- wp:paragraph --> <p><?php /* translators: %s: Customer first name */ printf( esc_html__( 'Hi %s,', 'woocommerce' ), '<!--[woocommerce/customer-first-name]-->' ); ?></p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p> <?php echo esc_html__( "Unfortunately, we couldn't complete your order due to an issue with your payment method.", 'woocommerce' ); ?> </p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p><?php /* translators: %s: Site title */ printf( esc_html__( "If you'd like to continue with your purchase, please return to %s and try a different method of payment.", 'woocommerce' ), '<!--[woocommerce/site-title]-->' ) ?></p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p> <?php echo esc_html__( 'Your order details are as follows:', 'woocommerce' ); ?> </p> <!-- /wp:paragraph --> <!-- wp:woocommerce/email-content {"lock":{"move":false,"remove":true}} --> <div class="wp-block-woocommerce-email-content"> <?php echo esc_html( BlockEmailRenderer::WOO_EMAIL_CONTENT_PLACEHOLDER ); ?> </div> <!-- /wp:woocommerce/email-content --> <!-- wp:paragraph --> <p><?php /* translators: %s: Store admin email */ printf( esc_html__( 'If you need any help with your order, please contact us at %s.', 'woocommerce' ), '<!--[woocommerce/store-email]-->' ); ?></p> <!-- /wp:paragraph --> block/customer-on-hold-order.php 0000777 00000004156 15253050367 0012702 0 ustar 00 <?php /** * Customer on-hold order email (initial block version) * * This template can be overridden by editing it in the WooCommerce email editor. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails\Block * @version 10.5.0 */ use Automattic\WooCommerce\Internal\EmailEditor\BlockEmailRenderer; defined( 'ABSPATH' ) || exit; // phpcs:disable Squiz.PHP.EmbeddedPhp.ContentBeforeOpen -- removed to prevent empty new lines. // phpcs:disable Squiz.PHP.EmbeddedPhp.ContentAfterEnd -- removed to prevent empty new lines. ?> <!-- wp:heading --> <h2 class="wp-block-heading"> <?php echo esc_html__( 'Thank you for your order', 'woocommerce' ); ?> </h2> <!-- /wp:heading --> <!-- wp:paragraph --> <p><?php /* translators: %s: Customer first name */ printf( esc_html__( 'Hi %s,', 'woocommerce' ), '<!--[woocommerce/customer-first-name]-->' ); ?></p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p> <?php echo esc_html__( 'We’ve received your order and it’s currently on hold until we can confirm your payment has been processed.', 'woocommerce' ); ?> </p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p> <?php echo esc_html__( 'Here’s a reminder of what you’ve ordered:', 'woocommerce' ); ?> </p> <!-- /wp:paragraph --> <!-- wp:woocommerce/email-content {"lock":{"move":false,"remove":true}} --> <div class="wp-block-woocommerce-email-content"> <?php echo esc_html( BlockEmailRenderer::WOO_EMAIL_CONTENT_PLACEHOLDER ); ?> </div> <!-- /wp:woocommerce/email-content --> <!-- wp:paragraph --> <p><?php /* translators: %s: Store admin email */ printf( esc_html__( 'Thanks again! If you need any help with your order, please contact us at %s.', 'woocommerce' ), '<!--[woocommerce/store-email]-->' ); ?></p> <!-- /wp:paragraph --> block/general-block-email.php 0000777 00000016766 15253050367 0012176 0 ustar 00 <?php /** * General block email * * Used to render information for the email editor WooCommerce content block (BlockEmailRenderer::WOO_EMAIL_CONTENT_PLACEHOLDER). * * The dynamic content part of the block can be placed here. * Examples include: * * 1. Content with a lot of conditional logic * 2. Content that can not be generated by personalization tags * 3. Content for specific emails that does not include the typical WooCommerce order details * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails\Block * @version 10.5.0 */ defined( 'ABSPATH' ) || exit; // phpcs:disable Squiz.PHP.EmbeddedPhp.ContentBeforeOpen -- removed to prevent empty new lines. // phpcs:disable Squiz.PHP.EmbeddedPhp.ContentAfterEnd -- removed to prevent empty new lines. use Automattic\WooCommerce\Enums\OrderStatus; use Automattic\WooCommerce\Internal\Settings\PointOfSaleDefaultSettings; if ( 'customer_invoice' === $email->id ) : // Customer invoice email // We are keeping this here until we have a better way to handle conditional content in the email editor. ?> <?php if ( $order->needs_payment() ) { ?> <p><?php if ( $order->has_status( OrderStatus::FAILED ) ) { printf( wp_kses( /* translators: %1$s Site title, %2$s Order pay link */ __( 'Sorry, your order on %1$s was unsuccessful. Your order details are below, with a link to try your payment again: %2$s', 'woocommerce' ), array( 'a' => array( 'href' => array(), ), ) ), esc_html( get_bloginfo( 'name', 'display' ) ), '<a href="' . esc_url( $order->get_checkout_payment_url() ) . '">' . esc_html__( 'Pay for this order', 'woocommerce' ) . '</a>' ); } else { printf( wp_kses( /* translators: %1$s Site title, %2$s Order pay link */ __( 'An order has been created for you on %1$s. Your order details are below, with a link to make payment when you’re ready: %2$s', 'woocommerce' ), array( 'a' => array( 'href' => array(), ), ) ), esc_html( get_bloginfo( 'name', 'display' ) ), '<a href="' . esc_url( $order->get_checkout_payment_url() ) . '">' . esc_html__( 'Pay for this order', 'woocommerce' ) . '</a>' ); } ?></p> <?php } else { ?> <p><?php /* translators: %s Order date */ printf( esc_html__( 'Here are the details of your order placed on %s:', 'woocommerce' ), esc_html( wc_format_datetime( $order->get_date_created() ) ) ); ?></p> <?php } endif; if ( 'customer_new_account' === $email->id ) : ?> <?php if ( $set_password_url ) : ?> <p><a href="<?php echo esc_attr( $set_password_url ); ?>"><?php printf( esc_html__( 'Set your new password.', 'woocommerce' ) ); ?></a></p> <?php endif; endif; if ( 'customer_reset_password' === $email->id && isset( $reset_key, $user_id ) ) : // Customer reset password email. ?> <p> <a class="link" href="<?php echo esc_url( add_query_arg( array( 'key' => $reset_key, 'id' => $user_id, 'login' => rawurlencode( $user_login ) ), wc_get_endpoint_url( 'lost-password', '', wc_get_page_permalink( 'myaccount' ) ) ) ); ?>"><?php // phpcs:ignore WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound ?> <?php esc_html_e( 'Reset your password', 'woocommerce' ); ?> </a> </p> <?php endif; /** * Action hook for email classes to hook into the general block email template. * * @since 10.5.0 * @param bool $sent_to_admin Whether the email is being sent to admin. * @param bool $plain_text Whether the email is being sent as plain text. * @param WC_Email $email The email object. */ do_action( 'woocommerce_email_general_block_content', $sent_to_admin, $plain_text, $email ); /** * Filter the list of email IDs that should not display order details. * * @since 10.5.0 * @param array $emails_without_order_details Array of email IDs that should not display order details. */ $emails_without_order_details = apply_filters( 'woocommerce_emails_general_block_content_emails_without_order_details', array() ); $accounts_related_emails = array( 'customer_reset_password', 'customer_new_account', ); $emails_without_order_details = array_merge( $emails_without_order_details ?? array(), $accounts_related_emails ); if ( isset( $order ) && ! in_array( $email->id, $emails_without_order_details, true ) ) { /** * Woocommerce_email_order_details * * @hooked WC_Emails::order_details() Shows the order details table. * @hooked WC_Structured_Data::generate_order_data() Generates structured data. * @hooked WC_Structured_Data::output_structured_data() Outputs structured data. * @since 2.5.0 */ do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email ); /** * Woocommerce_email_order_meta * * @hooked WC_Emails::order_meta() Shows order meta data. * @since 2.0.17 */ do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email ); /** * Woocommerce_email_customer_details * * @hooked WC_Emails::customer_details() Shows customer details * @hooked WC_Emails::email_address() Shows email address * @since 2.5.0 */ do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email ); } if ( 'customer_pos_completed_order' === $email->id || 'customer_pos_refunded_order' === $email->id ) : if ( ! empty( get_option( 'woocommerce_pos_store_email', PointOfSaleDefaultSettings::get_default_store_email() ) ) || ! empty( get_option( 'woocommerce_pos_store_phone' ) ) || ! empty( get_option( 'woocommerce_pos_store_address', PointOfSaleDefaultSettings::get_default_store_address() ) ) ) : ?> <!-- wp:group --> <div class="wp-block-group"> <?php if ( ! empty( get_option( 'woocommerce_pos_store_name', PointOfSaleDefaultSettings::get_default_store_name() ) ) ) : ?> <!-- wp:heading {"level":3} --> <h3 class="wp-block-heading"><?php echo esc_html( get_option( 'woocommerce_pos_store_name', PointOfSaleDefaultSettings::get_default_store_name() ) ); ?></h3> <!-- /wp:heading --> <?php else : ?> <!-- wp:heading {"level":3} --> <h3 class="wp-block-heading"><?php echo esc_html__( 'Store Information', 'woocommerce' ); ?></h3> <!-- /wp:heading --> <?php endif; ?> <?php if ( ! empty( get_option( 'woocommerce_pos_store_email', PointOfSaleDefaultSettings::get_default_store_email() ) ) ) : ?> <!-- wp:paragraph --> <p><?php echo esc_html( get_option( 'woocommerce_pos_store_email', PointOfSaleDefaultSettings::get_default_store_email() ) ); ?></p> <!-- /wp:paragraph --> <?php endif; ?> <?php if ( ! empty( get_option( 'woocommerce_pos_store_phone' ) ) ) : ?> <!-- wp:paragraph --> <p><?php echo esc_html( get_option( 'woocommerce_pos_store_phone' ) ); ?></p> <!-- /wp:paragraph --> <?php endif; ?> <?php if ( ! empty( get_option( 'woocommerce_pos_store_address', PointOfSaleDefaultSettings::get_default_store_address() ) ) ) : ?> <!-- wp:paragraph --> <p><?php echo esc_html( get_option( 'woocommerce_pos_store_address', PointOfSaleDefaultSettings::get_default_store_address() ) ); ?></p> <!-- /wp:paragraph --> <?php endif; ?> </div> <!-- /wp:group --> <?php endif; if ( ! empty( get_option( 'woocommerce_pos_refund_returns_policy' ) ) ) : ?> <!-- wp:group --> <div class="wp-block-group"> <!-- wp:heading {"level":3} --> <h3><?php echo esc_html__( 'Refund & Returns Policy', 'woocommerce' ); ?></h3> <!-- /wp:heading --> <!-- wp:paragraph --> <p><?php echo esc_html( get_option( 'woocommerce_pos_refund_returns_policy' ) ); ?></p> <!-- /wp:paragraph --> </div> <!-- /wp:group --> <?php endif; endif; block/customer-completed-order.php 0000777 00000004062 15253050367 0013312 0 ustar 00 <?php /** * Customer completed order email (initial block content) * * This template can be overridden by editing it in the WooCommerce email editor. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails\Block * @version 10.2.0 */ use Automattic\WooCommerce\Internal\EmailEditor\BlockEmailRenderer; defined( 'ABSPATH' ) || exit; // phpcs:disable Squiz.PHP.EmbeddedPhp.ContentBeforeOpen -- removed to prevent empty new lines. // phpcs:disable Squiz.PHP.EmbeddedPhp.ContentAfterEnd -- removed to prevent empty new lines. ?> <!-- wp:heading --> <h2 class="wp-block-heading"> <?php echo esc_html__( 'Good things are heading your way!', 'woocommerce' ); ?> </h2> <!-- /wp:heading --> <!-- wp:paragraph --> <p><?php /* translators: %s: Customer first name */ printf( esc_html__( 'Hi %s,', 'woocommerce' ), '<!--[woocommerce/customer-first-name]-->' ); ?></p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p> <?php echo esc_html__( 'We have finished processing your order.', 'woocommerce' ); ?> </p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p> <?php echo esc_html__( 'Here’s a reminder of what you’ve ordered:', 'woocommerce' ); ?> </p> <!-- /wp:paragraph --> <!-- wp:woocommerce/email-content {"lock":{"move":false,"remove":true}} --> <div class="wp-block-woocommerce-email-content"> <?php echo esc_html( BlockEmailRenderer::WOO_EMAIL_CONTENT_PLACEHOLDER ); ?> </div> <!-- /wp:woocommerce/email-content --> <!-- wp:paragraph --> <p><?php /* translators: %s: Store admin email */ printf( esc_html__( 'Thanks again! If you need any help with your order, please contact us at %s.', 'woocommerce' ), '<!--[woocommerce/store-email]-->' ); ?></p> <!-- /wp:paragraph --> block/default-block-content.php 0000777 00000003011 15253050367 0012543 0 ustar 00 <?php /** * This is the default block content for the WooCommerce email editor. * * We show this when the plugin/theme developer has not provided a custom template. * * New block initial content should be placed in yourtheme/woocommerce/emails/block/email-id.php. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails\Block * @version 10.2.0 */ use Automattic\WooCommerce\Internal\EmailEditor\BlockEmailRenderer; defined( 'ABSPATH' ) || exit; // phpcs:disable Squiz.PHP.EmbeddedPhp.ContentBeforeOpen -- removed to prevent empty new lines. // phpcs:disable Squiz.PHP.EmbeddedPhp.ContentAfterEnd -- removed to prevent empty new lines. ?> <!-- wp:heading --> <h2 class="wp-block-heading"><?php esc_html_e( 'Default block content', 'woocommerce' ); ?></h2> <!-- /wp:heading --> <!-- wp:paragraph --> <p><?php /* translators: %s: Customer first name */ printf( esc_html__( 'Hi %s,', 'woocommerce' ), '<!--[woocommerce/customer-first-name]-->' ); ?></p> <!-- /wp:paragraph --> <!-- wp:woocommerce/email-content {"lock":{"move":false,"remove":true}} --> <div class="wp-block-woocommerce-email-content"> <?php echo esc_html( BlockEmailRenderer::WOO_EMAIL_CONTENT_PLACEHOLDER ); ?> </div> <!-- /wp:woocommerce/email-content --> <!-- wp:paragraph --> <p><?php /* translators: %s: Store admin email */ printf( esc_html__( 'Thanks again! If you need any help with your order, please contact us at %s.', 'woocommerce' ), '<!--[woocommerce/store-email]-->' ); ?></p> <!-- /wp:paragraph --> block/customer-fulfillment-deleted.php 0000777 00000003676 15253050367 0014164 0 ustar 00 <?php /** * Customer fulfillment deleted email (initial block version) * * This template can be overridden by editing it in the WooCommerce email editor. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails\Block * @version 10.5.0 */ use Automattic\WooCommerce\Internal\EmailEditor\BlockEmailRenderer; defined( 'ABSPATH' ) || exit; // phpcs:disable Squiz.PHP.EmbeddedPhp.ContentBeforeOpen -- removed to prevent empty new lines. // phpcs:disable Squiz.PHP.EmbeddedPhp.ContentAfterEnd -- removed to prevent empty new lines. ?> <!-- wp:heading --> <h2 class="wp-block-heading"> <?php echo esc_html__( 'One of your shipments has been removed', 'woocommerce' ); ?> </h2> <!-- /wp:heading --> <!-- wp:paragraph --> <p><?php echo esc_html__( 'We wanted to let you know that one of the previously fulfilled shipments from your order has been removed from our system. This may have been due to a correction or an update in our fulfillment records. Don’t worry — this won’t affect any items you’ve already received.', 'woocommerce' ); ?></p> <!-- /wp:paragraph --> <!-- wp:woocommerce/email-content {"lock":{"move":false,"remove":true}} --> <div class="wp-block-woocommerce-email-content"> <?php echo esc_html( BlockEmailRenderer::WOO_EMAIL_CONTENT_PLACEHOLDER ); ?> </div> <!-- /wp:woocommerce/email-content --> <!-- wp:paragraph --> <p><?php echo esc_html__( 'If you have any questions or notice anything unexpected, feel free to reach out to our support team through your account or reply to this email.', 'woocommerce' ); ?></p> <!-- /wp:paragraph --> block/customer-fulfillment-updated.php 0000777 00000003555 15253050367 0014200 0 ustar 00 <?php /** * Customer fulfillment updated email (initial block version) * * This template can be overridden by editing it in the WooCommerce email editor. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails\Block * @version 10.5.0 */ use Automattic\WooCommerce\Internal\EmailEditor\BlockEmailRenderer; defined( 'ABSPATH' ) || exit; // phpcs:disable Squiz.PHP.EmbeddedPhp.ContentBeforeOpen -- removed to prevent empty new lines. // phpcs:disable Squiz.PHP.EmbeddedPhp.ContentAfterEnd -- removed to prevent empty new lines. ?> <!-- wp:heading --> <h2 class="wp-block-heading"> <?php echo esc_html__( 'Your shipment has been updated', 'woocommerce' ); ?> </h2> <!-- /wp:heading --> <!-- wp:paragraph --> <p><?php echo esc_html__( 'Some details of your shipment have recently been updated. This may include tracking information, item contents, or delivery status.', 'woocommerce' ); ?></p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p><?php echo esc_html__( 'Here’s the latest info we have:', 'woocommerce' ); ?></p> <!-- /wp:paragraph --> <!-- wp:woocommerce/email-content {"lock":{"move":false,"remove":true}} --> <div class="wp-block-woocommerce-email-content"> <?php echo esc_html( BlockEmailRenderer::WOO_EMAIL_CONTENT_PLACEHOLDER ); ?> </div> <!-- /wp:woocommerce/email-content --> <!-- wp:paragraph --> <p><?php echo esc_html__( 'If anything looks off or you have questions, feel free to contact our support team.', 'woocommerce' ); ?></p> <!-- /wp:paragraph --> customer-fulfillment-deleted.php 0000777 00000006722 15253050367 0013065 0 ustar 00 <?php /** * Customer fulfillment deleted email * * This template can be overridden by copying it to yourtheme/woocommerce/emails/customer-fulfillment-deleted.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails\HTML * @version 10.4.0 */ defined( 'ABSPATH' ) || exit; /** * Hook for the woocommerce_email_header. * * @param string $email_heading The email heading. * @param WC_Email $email The email object. * @since 2.5.0 * * @hooked WC_Emails::email_header() Output the email header */ do_action( 'woocommerce_email_header', $email_heading, $email ); ?> <div class="email-introduction"> <p><?php echo esc_html__( 'We wanted to let you know that one of the previously fulfilled shipments from your order has been removed from our system. This may have been due to a correction or an update in our fulfillment records. Don’t worry — this won’t affect any items you’ve already received.', 'woocommerce' ); ?></p> </div> <?php /** * Hook for the woocommerce_email_fulfillment_details. * * @since 10.1.0 * @param WC_Order $order The order object. * @param Fulfillment $fulfillment The fulfillment object. * @param bool $sent_to_admin Whether the email is sent to admin. * @param bool $plain_text Whether the email is plain text. * @param WC_Email $email The email object. * * @hooked WC_Emails::fulfillment_details() Shows the fulfillment details. */ do_action( 'woocommerce_email_fulfillment_details', $order, $fulfillment, $sent_to_admin, $plain_text, $email ); /** * Hook for the woocommerce_email_fulfillment_meta. * * @param WC_Order $order The order object. * @param Fulfillment $fulfillment The fulfillment object. * @param bool $sent_to_admin Whether the email is sent to admin. * @param bool $plain_text Whether the email is plain text. * @param WC_Email $email The email object. * @since 10.1.0 * * @hooked WC_Emails::order_meta() Shows fulfillment meta data. */ do_action( 'woocommerce_email_fulfillment_meta', $order, $fulfillment, $sent_to_admin, $plain_text, $email ); /** * Hook for woocommerce_email_customer_details. * * @param WC_Order $order The order object. * @param bool $sent_to_admin Whether the email is sent to admin. * @param bool $plain_text Whether the email is plain text. * @param WC_Email $email The email object. * @since 2.5.0 * * @hooked WC_Emails::customer_details() Shows customer details * @hooked WC_Emails::email_address() Shows email address */ do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email ); /** * Show user-defined additional content - this is set in each email's settings. */ if ( $additional_content ) { echo '<table border="0" cellpadding="0" cellspacing="0" width="100%" role="presentation"><tr><td class="email-additional-content">'; echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) ); echo '</td></tr></table>'; } /** * Hook for the woocommerce_email_footer. * * @param WC_Email $email The email object. * @since 2.5.0 * * @hooked WC_Emails::email_footer() Output the email footer */ do_action( 'woocommerce_email_footer', $email ); customer-fulfillment-updated.php 0000777 00000006630 15253050367 0013103 0 ustar 00 <?php /** * Customer fulfillment updated email * * This template can be overridden by copying it to yourtheme/woocommerce/emails/customer-fulfillment-updated.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails\HTML * @version 10.4.0 */ defined( 'ABSPATH' ) || exit; /** * Hook for the woocommerce_email_header. * * @param string $email_heading The email heading. * @param WC_Email $email The email object. * @since 2.5.0 * * @hooked WC_Emails::email_header() Output the email header */ do_action( 'woocommerce_email_header', $email_heading, $email ); ?> <div class="email-introduction"> <p><?php echo esc_html__( 'Some details of your shipment have recently been updated. This may include tracking information, item contents, or delivery status.', 'woocommerce' ); ?></p> <p><?php echo esc_html__( 'Here’s the latest info we have:', 'woocommerce' ); ?></p> </div> <?php /** * Hook for the woocommerce_email_fulfillment_details. * * @since 10.1.0 * @param WC_Order $order The order object. * @param Fulfillment $fulfillment The fulfillment object. * @param bool $sent_to_admin Whether the email is sent to admin. * @param bool $plain_text Whether the email is plain text. * @param WC_Email $email The email object. * * @hooked WC_Emails::fulfillment_details() Shows the fulfillment details. */ do_action( 'woocommerce_email_fulfillment_details', $order, $fulfillment, $sent_to_admin, $plain_text, $email ); /** * Hook for the woocommerce_email_fulfillment_meta. * * @param WC_Order $order The order object. * @param Fulfillment $fulfillment The fulfillment object. * @param bool $sent_to_admin Whether the email is sent to admin. * @param bool $plain_text Whether the email is plain text. * @param WC_Email $email The email object. * @since 10.1.0 * * @hooked WC_Emails::order_meta() Shows fulfillment meta data. */ do_action( 'woocommerce_email_fulfillment_meta', $order, $fulfillment, $sent_to_admin, $plain_text, $email ); /** * Hook for woocommerce_email_customer_details. * * @param WC_Order $order The order object. * @param bool $sent_to_admin Whether the email is sent to admin. * @param bool $plain_text Whether the email is plain text. * @param WC_Email $email The email object. * @since 2.5.0 * * @hooked WC_Emails::customer_details() Shows customer details * @hooked WC_Emails::email_address() Shows email address */ do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email ); /** * Show user-defined additional content - this is set in each email's settings. */ if ( $additional_content ) { echo '<table border="0" cellpadding="0" cellspacing="0" width="100%" role="presentation"><tr><td class="email-additional-content">'; echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) ); echo '</td></tr></table>'; } /** * Hook for the woocommerce_email_footer. * * @param WC_Email $email The email object. * @since 2.5.0 * * @hooked WC_Emails::email_footer() Output the email footer */ do_action( 'woocommerce_email_footer', $email ); email-customer-details.php 0000777 00000002270 15253050367 0011644 0 ustar 00 <?php /** * Additional Customer Details * * This is extra customer data which can be filtered by plugins. It outputs below the order item table. * * This template can be overridden by copying it to yourtheme/woocommerce/emails/email-customer-details.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails * @version 9.7.0 */ defined( 'ABSPATH' ) || exit; ?> <?php if ( ! empty( $fields ) ) : ?> <div class="font-family" style="margin-bottom: 40px;"> <h2><?php esc_html_e( 'Customer details', 'woocommerce' ); ?></h2> <ul> <?php foreach ( $fields as $field ) : ?> <li><strong><?php echo wp_kses_post( $field['label'] ); ?>:</strong> <span class="text"><?php echo wp_kses_post( $field['value'] ); ?></span></li> <?php endforeach; ?> </ul> </div> <?php endif; ?> email-order-details.php 0000777 00000014520 15253050367 0011117 0 ustar 00 <?php /** * Order details table shown in emails. * * This template can be overridden by copying it to yourtheme/woocommerce/emails/email-order-details.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails * @version 10.4.0 */ use Automattic\WooCommerce\Utilities\FeaturesUtil; defined( 'ABSPATH' ) || exit; $text_align = is_rtl() ? 'right' : 'left'; $email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' ); $heading_class = $email_improvements_enabled ? 'email-order-detail-heading' : ''; $order_table_class = $email_improvements_enabled ? 'email-order-details' : ''; $order_total_text_align = $email_improvements_enabled ? 'right' : 'left'; $order_quantity_text_align = $email_improvements_enabled ? 'right' : 'left'; if ( $email_improvements_enabled ) { add_filter( 'woocommerce_order_shipping_to_display_shipped_via', '__return_false' ); } /** * Action hook to add custom content before order details in email. * * @param WC_Order $order Order object. * @param bool $sent_to_admin Whether it's sent to admin or customer. * @param bool $plain_text Whether it's a plain text email. * @param WC_Email $email Email object. * @since 2.5.0 */ do_action( 'woocommerce_email_before_order_table', $order, $sent_to_admin, $plain_text, $email ); ?> <h2 class="<?php echo esc_attr( $heading_class ); ?>"> <?php if ( $email_improvements_enabled ) { echo wp_kses_post( __( 'Order summary', 'woocommerce' ) ); } if ( $sent_to_admin ) { $before = '<a class="link" href="' . esc_url( $order->get_edit_order_url() ) . '">'; $after = '</a>'; } else { $before = ''; $after = ''; } if ( $email_improvements_enabled ) { echo '<br><span>'; } /* translators: %s: Order ID. */ $order_number_string = __( '[Order #%s]', 'woocommerce' ); if ( $email_improvements_enabled ) { /* translators: %s: Order ID. */ $order_number_string = __( 'Order #%s', 'woocommerce' ); } echo wp_kses_post( $before . sprintf( $order_number_string . $after . ' (<time datetime="%s">%s</time>)', $order->get_order_number(), $order->get_date_created()->format( 'c' ), wc_format_datetime( $order->get_date_created() ) ) ); if ( $email_improvements_enabled ) { echo '</span>'; } ?> </h2> <div style="margin-bottom: <?php echo $email_improvements_enabled ? '24px' : '40px'; ?>;"> <table class="td font-family <?php echo esc_attr( $order_table_class ); ?>" cellspacing="0" cellpadding="6" style="width: 100%;" border="1"> <thead> <tr> <th class="td" scope="col" style="text-align:<?php echo esc_attr( $text_align ); ?>;"><?php esc_html_e( 'Product', 'woocommerce' ); ?></th> <th class="td" scope="col" style="text-align:<?php echo esc_attr( $order_quantity_text_align ); ?>;"><?php esc_html_e( 'Quantity', 'woocommerce' ); ?></th> <th class="td" scope="col" style="text-align:<?php echo esc_attr( $order_total_text_align ); ?>;"><?php esc_html_e( 'Price', 'woocommerce' ); ?></th> </tr> </thead> <tbody> <?php $image_size = $email_improvements_enabled ? 48 : 32; echo wc_get_email_order_items( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped $order, array( 'show_sku' => $sent_to_admin, 'show_image' => $email_improvements_enabled, 'image_size' => array( $image_size, $image_size ), 'plain_text' => $plain_text, 'sent_to_admin' => $sent_to_admin, ) ); ?> </tbody> </table> <table class="td font-family <?php echo esc_attr( $order_table_class ); ?>" cellspacing="0" cellpadding="6" style="width: 100%;" border="1"> <?php $item_totals = $order->get_order_item_totals(); $item_totals_count = count( $item_totals ); if ( $item_totals ) { $i = 0; foreach ( $item_totals as $total ) { ++$i; $last_class = ( $i === $item_totals_count ) ? ' order-totals-last' : ''; ?> <tr class="order-totals order-totals-<?php echo esc_attr( $total['type'] ?? 'unknown' ); ?><?php echo esc_attr( $last_class ); ?>"> <th class="td text-align-left" scope="row" colspan="2" style="<?php echo ( 1 === $i ) ? 'border-top-width: 4px;' : ''; ?>"> <?php echo wp_kses_post( $total['label'] ) . ' '; if ( $email_improvements_enabled ) { echo isset( $total['meta'] ) ? wp_kses_post( $total['meta'] ) : ''; } ?> </th> <td class="td text-align-<?php echo esc_attr( $order_total_text_align ); ?>" style="<?php echo ( 1 === $i ) ? 'border-top-width: 4px;' : ''; ?>"><?php echo wp_kses_post( $total['value'] ); ?></td> </tr> <?php } } if ( $order->get_customer_note() && ! $email_improvements_enabled ) { ?> <tr> <th class="td text-align-left" scope="row" colspan="2"><?php esc_html_e( 'Note:', 'woocommerce' ); ?></th> <td class="td text-align-left"><?php echo wp_kses( nl2br( wc_wptexturize_order_note( $order->get_customer_note() ) ), array() ); ?></td> </tr> <?php } ?> </table> <?php if ( $order->get_customer_note() && $email_improvements_enabled ) { ?> <table class="td font-family <?php echo esc_attr( $order_table_class ); ?>" cellspacing="0" cellpadding="6" style="width: 100%;" border="1" role="presentation"> <tr class="order-customer-note"> <td class="td text-align-left"> <b><?php esc_html_e( 'Customer note', 'woocommerce' ); ?></b><br> <?php echo wp_kses( nl2br( wc_wptexturize_order_note( $order->get_customer_note() ) ), array( 'br' => array() ) ); ?> </td> </tr> </table> <?php } ?> </div> <?php if ( $email_improvements_enabled ) { remove_filter( 'woocommerce_order_shipping_to_display_shipped_via', '__return_false' ); } /** * Action hook to add custom content after order details in email. * * @param WC_Order $order Order object. * @param bool $sent_to_admin Whether it's sent to admin or customer. * @param bool $plain_text Whether it's a plain text email. * @param WC_Email $email Email object. * @since 2.5.0 */ do_action( 'woocommerce_email_after_order_table', $order, $sent_to_admin, $plain_text, $email ); ?> customer-processing-order.php 0000777 00000006210 15253050367 0012415 0 ustar 00 <?php /** * Customer processing order email * * This template can be overridden by copying it to yourtheme/woocommerce/emails/customer-processing-order.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails * @version 10.4.0 */ use Automattic\WooCommerce\Utilities\FeaturesUtil; if ( ! defined( 'ABSPATH' ) ) { exit; } $email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' ); /* * @hooked WC_Emails::email_header() Output the email header */ do_action( 'woocommerce_email_header', $email_heading, $email ); ?> <?php echo $email_improvements_enabled ? '<div class="email-introduction">' : ''; ?> <p> <?php if ( ! empty( $order->get_billing_first_name() ) ) { /* translators: %s: Customer first name */ printf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_billing_first_name() ) ); } else { printf( esc_html__( 'Hi,', 'woocommerce' ) ); } ?> </p> <?php if ( $email_improvements_enabled ) : ?> <p><?php esc_html_e( 'Just to let you know — we’ve received your order, and it is now being processed.', 'woocommerce' ); ?></p> <p><?php esc_html_e( 'Here’s a reminder of what you’ve ordered:', 'woocommerce' ); ?></p> <?php else : ?> <?php /* translators: %s: Order number */ ?> <p><?php printf( esc_html__( 'Just to let you know — we\'ve received your order #%s, and it is now being processed:', 'woocommerce' ), esc_html( $order->get_order_number() ) ); ?></p> <?php endif; ?> <?php echo $email_improvements_enabled ? '</div>' : ''; ?> <?php /* * @hooked WC_Emails::order_details() Shows the order details table. * @hooked WC_Structured_Data::generate_order_data() Generates structured data. * @hooked WC_Structured_Data::output_structured_data() Outputs structured data. * @since 2.5.0 */ do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email ); /* * @hooked WC_Emails::order_meta() Shows order meta data. */ do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email ); /* * @hooked WC_Emails::customer_details() Shows customer details * @hooked WC_Emails::email_address() Shows email address */ do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email ); /** * Show user-defined additional content - this is set in each email's settings. */ if ( $additional_content ) { echo $email_improvements_enabled ? '<table border="0" cellpadding="0" cellspacing="0" width="100%" role="presentation"><tr><td class="email-additional-content">' : ''; echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) ); echo $email_improvements_enabled ? '</td></tr></table>' : ''; } /* * @hooked WC_Emails::email_footer() Output the email footer */ do_action( 'woocommerce_email_footer', $email ); customer-completed-order.php 0000777 00000005527 15253050367 0012227 0 ustar 00 <?php /** * Customer completed order email * * This template can be overridden by copying it to yourtheme/woocommerce/emails/customer-completed-order.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails * @version 10.4.0 */ use Automattic\WooCommerce\Utilities\FeaturesUtil; if ( ! defined( 'ABSPATH' ) ) { exit; } $email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' ); /* * @hooked WC_Emails::email_header() Output the email header */ do_action( 'woocommerce_email_header', $email_heading, $email ); ?> <?php echo $email_improvements_enabled ? '<div class="email-introduction">' : ''; ?> <p> <?php if ( ! empty( $order->get_billing_first_name() ) ) { /* translators: %s: Customer first name */ printf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_billing_first_name() ) ); } else { printf( esc_html__( 'Hi,', 'woocommerce' ) ); } ?> </p> <p><?php esc_html_e( 'We have finished processing your order.', 'woocommerce' ); ?></p> <?php if ( $email_improvements_enabled ) : ?> <p><?php esc_html_e( 'Here’s a reminder of what you’ve ordered:', 'woocommerce' ); ?></p> <?php endif; ?> <?php echo $email_improvements_enabled ? '</div>' : ''; ?> <?php /* * @hooked WC_Emails::order_details() Shows the order details table. * @hooked WC_Structured_Data::generate_order_data() Generates structured data. * @hooked WC_Structured_Data::output_structured_data() Outputs structured data. * @since 2.5.0 */ do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email ); /* * @hooked WC_Emails::order_meta() Shows order meta data. */ do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email ); /* * @hooked WC_Emails::customer_details() Shows customer details * @hooked WC_Emails::email_address() Shows email address */ do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email ); /** * Show user-defined additional content - this is set in each email's settings. */ if ( $additional_content ) { echo $email_improvements_enabled ? '<table border="0" cellpadding="0" cellspacing="0" width="100%" role="presentation"><tr><td class="email-additional-content">' : ''; echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) ); echo $email_improvements_enabled ? '</td></tr></table>' : ''; } /* * @hooked WC_Emails::email_footer() Output the email footer */ do_action( 'woocommerce_email_footer', $email ); customer-refunded-order.php 0000777 00000007015 15253050367 0012041 0 ustar 00 <?php /** * Customer refunded order email * * This template can be overridden by copying it to yourtheme/woocommerce/emails/customer-refunded-order.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails * @version 10.4.0 */ use Automattic\WooCommerce\Utilities\FeaturesUtil; defined( 'ABSPATH' ) || exit; $email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' ); /* * @hooked WC_Emails::email_header() Output the email header */ do_action( 'woocommerce_email_header', $email_heading, $email ); ?> <?php echo $email_improvements_enabled ? '<div class="email-introduction">' : ''; ?> <p> <?php if ( ! empty( $order->get_billing_first_name() ) ) { /* translators: %s: Customer first name */ printf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_billing_first_name() ) ); } else { printf( esc_html__( 'Hi,', 'woocommerce' ) ); } ?> </p> <p> <?php if ( $email_improvements_enabled ) { if ( $partial_refund ) { /* translators: %s: Site title */ echo sprintf( esc_html__( 'Your order from %s has been partially refunded.', 'woocommerce' ), esc_html( $blogname ) ) . "\n\n"; } else { /* translators: %s: Site title */ echo sprintf( esc_html__( 'Your order from %s has been refunded.', 'woocommerce' ), esc_html( $blogname ) ) . "\n\n"; } echo '</p><p>'; echo esc_html__( 'Here’s a reminder of what you’ve ordered:', 'woocommerce' ) . "\n\n"; } elseif ( $partial_refund ) { /* translators: %s: Site title */ printf( esc_html__( 'Your order on %s has been partially refunded. There are more details below for your reference:', 'woocommerce' ), esc_html( $blogname ) ); } else { /* translators: %s: Site title */ printf( esc_html__( 'Your order on %s has been refunded. There are more details below for your reference:', 'woocommerce' ), esc_html( $blogname ) ); } ?> </p> <?php echo $email_improvements_enabled ? '</div>' : ''; ?> <?php /* * @hooked WC_Emails::order_details() Shows the order details table. * @hooked WC_Structured_Data::generate_order_data() Generates structured data. * @hooked WC_Structured_Data::output_structured_data() Outputs structured data. * @since 2.5.0 */ do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email ); /* * @hooked WC_Emails::order_meta() Shows order meta data. */ do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email ); /* * @hooked WC_Emails::customer_details() Shows customer details * @hooked WC_Emails::email_address() Shows email address */ do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email ); /** * Show user-defined additional content - this is set in each email's settings. */ if ( $additional_content ) { echo $email_improvements_enabled ? '<table border="0" cellpadding="0" cellspacing="0" width="100%" role="presentation"><tr><td class="email-additional-content">' : ''; echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) ); echo $email_improvements_enabled ? '</td></tr></table>' : ''; } /* * @hooked WC_Emails::email_footer() Output the email footer */ do_action( 'woocommerce_email_footer', $email ); customer-stock-notification.php 0000777 00000007221 15253050367 0012742 0 ustar 00 <?php /** * Customer back-in-stock notification email. * * This template can be overridden by copying it to yourtheme/woocommerce/emails/customer-stock-notification.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails * @version 10.2.0 */ // Exit if accessed directly. if ( ! defined( 'ABSPATH' ) ) { exit; } /** * Hook: woocommerce_email_header. * * @since 10.2.0 * * @hooked WC_Emails::email_header() Output the email header */ do_action( 'woocommerce_email_header', $email_heading, $email ); ?> <table border="0" cellpadding="0" cellspacing="0" id="notification__container"><tr><td> <div id="notification__into_content"> <?php echo wp_kses_post( wpautop( wptexturize( $intro_content ) ) ); ?> </div> <div id="notification__product"> <?php /** * Hook: woocommerce_email_stock_notification_product. * * @since 10.2.0 * * @hooked \Automattic\WooCommerce\Internal\StockNotifications\Templates::email_product_image - 10 * @hooked \Automattic\WooCommerce\Internal\StockNotifications\Templates::email_product_title - 20 * @hooked \Automattic\WooCommerce\Internal\StockNotifications\Templates::email_product_attributes - 30 * @hooked \Automattic\WooCommerce\Internal\StockNotifications\Templates::email_product_price - 40 */ do_action( 'woocommerce_email_stock_notification_product', $product, $notification, $plain_text, $email ); ?> <a href="<?php echo esc_url( $button_link ); ?>" id="notification__action_button"> <?php echo esc_html( $button_text ); ?> </a> </div> <table id="notification__footer"><tr><td> <?php echo esc_html( __( 'You have received this message because your e-mail address was used to sign up for stock notifications on our store.', 'woocommerce' ) ); if ( ! $is_guest ) { // translators: %1$s placeholder is the unsubscribe link, %2$s placeholder is the Unsubscribe text link. $unsubscribe_link_tag = sprintf( '<a href="%1$s" id="notification__unsubscribe_link">%2$s</a>', esc_url( $unsubscribe_link ), _x( 'click here', 'unsubscribe cta for stock notifications for existing customers', 'woocommerce' ) ); // translators: %s placeholder is the text part from above. echo wp_kses_post( sprintf( __( 'To manage your notifications, %s to log in to your account.', 'woocommerce' ), $unsubscribe_link_tag ) ); } else { // translators: %1$s placeholder is the unsubscribe link, %2$s placeholder is the Unsubscribe text link. $unsubscribe_link_tag = sprintf( '<a href="%1$s" id="notification__unsubscribe_link">%2$s</a>', esc_url( $unsubscribe_link ), _x( 'click here', 'unsubscribe cta for stock notifications for guests', 'woocommerce' ) ); // translators: %s placeholder is the text part from above. echo wp_kses_post( sprintf( __( 'To stop receiving these messages, %s to unsubscribe.', 'woocommerce' ), $unsubscribe_link_tag ) ); } ?> <br><br> <?php /** * Show user-defined additional content - this is set in each email's settings. */ if ( $additional_content ) { echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) ); } ?> </td></tr></table> </td></tr></table> <?php /** * Hook: woocommerce_email_footer. * * @since 10.2.0 * * @hooked WC_Emails::email_footer() Output the email footer */ do_action( 'woocommerce_email_footer', $email ); email-fulfillment-items.php 0000777 00000012571 15253050367 0012025 0 ustar 00 <?php /** * Email Fulfillment Items * * This template can be overridden by copying it to yourtheme/woocommerce/emails/email-fulfillment-items.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails * @version 10.1.0 */ use Automattic\WooCommerce\Utilities\FeaturesUtil; defined( 'ABSPATH' ) || exit; $margin_side = is_rtl() ? 'left' : 'right'; $price_text_align = 'right'; foreach ( $items as $item_id => $item ) : $product = $item->item->get_product(); $sku = ''; $purchase_note = ''; $image = ''; /** * Email Order Item Visibility hook. * * This filter allows you to control the visibility of order items in emails. * * @param bool $visible Whether the item is visible in the email. * @param WC_Order_Item_Product $item The order item object. * @since 2.1.0 */ if ( ! apply_filters( 'woocommerce_order_item_visible', true, $item->item ) ) { continue; } if ( is_object( $product ) ) { $sku = $product->get_sku(); $purchase_note = $product->get_purchase_note(); $image = $product->get_image( $image_size ); } /** * Email Order Item Thumbnail hook. * * @since 2.1.0 */ $order_item_class = apply_filters( 'woocommerce_order_item_class', 'order_item', $item->item, $order ); ?> <tr class="<?php echo esc_attr( $order_item_class ); ?>"> <td class="td font-family text-align-left" style="vertical-align: middle; word-wrap:break-word;"> <table class="order-item-data"> <tr> <?php // Show title/image etc. if ( $show_image ) { /** * Email Order Item Thumbnail hook. * * @param string $image The image HTML. * @param WC_Order_Item_Product $item The item being displayed. * @since 2.1.0 */ echo '<td>' . wp_kses_post( apply_filters( 'woocommerce_order_item_thumbnail', $image, $item->item ) ) . '</td>'; } ?> <td> <?php /** * Order Item Name hook. * * @param string $item_name The item name HTML. * @param WC_Order_Item_Product $item The item being displayed. * @since 2.1.0 */ echo wp_kses_post( apply_filters( 'woocommerce_order_item_name', $item->item->get_name(), $item->item, false ) ); // SKU. if ( $show_sku && $sku ) { echo wp_kses_post( ' (#' . $sku . ')' ); } /** * Allow other plugins to add additional product information. * * @param int $item_id The item ID. * @param WC_Order_Item_Product $item The item object. * @param WC_Order $order The order object. * @param bool $plain_text Whether the email is plain text or not. * @since 2.3.0 */ do_action( 'woocommerce_order_item_meta_start', $item_id, $item->item, $order, $plain_text ); $item_meta = wc_display_item_meta( $item->item, array( 'before' => '', 'after' => '', 'separator' => '<br>', 'echo' => false, 'label_before' => '<span>', 'label_after' => ':</span> ', ) ); echo '<div class="email-order-item-meta">'; // Using wp_kses instead of wp_kses_post to remove all block elements. echo wp_kses( $item_meta, array( 'br' => array(), 'span' => array(), 'a' => array( 'href' => true, 'target' => true, 'rel' => true, 'title' => true, ), ) ); echo '</div>'; /** * Allow other plugins to add additional product information. * * @param int $item_id The item ID. * @param WC_Order_Item_Product $item The item object. * @param WC_Order $order The order object. * @param bool $plain_text Whether the email is plain text or not. * @since 2.3.0 */ do_action( 'woocommerce_order_item_meta_end', $item_id, $item->item, $order, $plain_text ); ?> </td> </tr> </table> </td> <td class="td font-family text-align-<?php echo esc_attr( $price_text_align ); ?>" style="vertical-align:middle;"> <?php echo '×'; $qty = $item->qty; $qty_display = esc_html( $qty ); /** * Email Order Item Quantity hook. * * @since 2.4.0 */ echo wp_kses_post( apply_filters( 'woocommerce_email_order_item_quantity', $qty_display, $item->item ) ); ?> </td> <td class="td font-family text-align-<?php echo esc_attr( $price_text_align ); ?>" style="vertical-align:middle;"> <?php echo wp_kses_post( $order->get_formatted_line_subtotal( $item->item ) ); ?> </td> </tr> <?php if ( $show_purchase_note && $purchase_note ) { ?> <tr> <td colspan="3" class="font-family text-align-left" style="vertical-align:middle;"> <?php echo wp_kses_post( wpautop( do_shortcode( $purchase_note ) ) ); ?> </td> </tr> <?php } ?> <?php endforeach; ?> customer-new-account.php 0000777 00000007521 15253050367 0011361 0 ustar 00 <?php /** * Customer new account email * * This template can be overridden by copying it to yourtheme/woocommerce/emails/customer-new-account.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails * @version 10.4.0 */ use Automattic\WooCommerce\Utilities\FeaturesUtil; defined( 'ABSPATH' ) || exit; $email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' ); /** * Fires to output the email header. * * @hooked WC_Emails::email_header() * * @since 3.7.0 */ do_action( 'woocommerce_email_header', $email_heading, $email ); ?> <?php echo $email_improvements_enabled ? '<div class="email-introduction">' : ''; ?> <?php /* translators: %s: Customer username */ ?> <p><?php printf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $user_login ) ); ?></p> <?php if ( $email_improvements_enabled ) : ?> <?php /* translators: %s: Site title */ ?> <p><?php printf( esc_html__( 'Thanks for creating an account on %s. Here’s a copy of your user details.', 'woocommerce' ), esc_html( $blogname ) ); ?></p> <div class="hr hr-top"></div> <?php /* translators: %s: Username */ ?> <p><?php echo wp_kses( sprintf( __( 'Username: <b>%s</b>', 'woocommerce' ), esc_html( $user_login ) ), array( 'b' => array() ) ); ?></p> <?php if ( $password_generated && $set_password_url ) : ?> <?php // If the password has not been set by the user during the sign up process, send them a link to set a new password. ?> <p><a href="<?php echo esc_attr( $set_password_url ); ?>"><?php printf( esc_html__( 'Set your new password.', 'woocommerce' ) ); ?></a></p> <?php endif; ?> <div class="hr hr-bottom"></div> <p><?php echo esc_html__( 'You can access your account area to view orders, change your password, and more via the link below:', 'woocommerce' ); ?></p> <p><a href="<?php echo esc_attr( wc_get_page_permalink( 'myaccount' ) ); ?>"><?php printf( esc_html__( 'My account', 'woocommerce' ) ); ?></a></p> <?php else : ?> <?php /* translators: %1$s: Site title, %2$s: Username, %3$s: My account link */ ?> <p><?php printf( esc_html__( 'Thanks for creating an account on %1$s. Your username is %2$s. You can access your account area to view orders, change your password, and more at: %3$s', 'woocommerce' ), esc_html( $blogname ), '<strong>' . esc_html( $user_login ) . '</strong>', make_clickable( esc_url( wc_get_page_permalink( 'myaccount' ) ) ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></p> <?php if ( $password_generated && $set_password_url ) : ?> <?php // If the password has not been set by the user during the sign up process, send them a link to set a new password. ?> <p><a href="<?php echo esc_attr( $set_password_url ); ?>"><?php printf( esc_html__( 'Click here to set your new password.', 'woocommerce' ) ); ?></a></p> <?php endif; ?> <?php endif; ?> <?php echo $email_improvements_enabled ? '</div>' : ''; ?> <?php /** * Show user-defined additional content - this is set in each email's settings. */ if ( $additional_content ) { echo $email_improvements_enabled ? '<table border="0" cellpadding="0" cellspacing="0" width="100%" role="presentation"><tr><td class="email-additional-content email-additional-content-aligned">' : ''; echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) ); echo $email_improvements_enabled ? '</td></tr></table>' : ''; } /** * Fires to output the email footer. * * @hooked WC_Emails::email_footer() * * @since 3.7.0 */ do_action( 'woocommerce_email_footer', $email ); customer-invoice.php 0000777 00000010253 15253050367 0010566 0 ustar 00 <?php /** * Customer invoice email * * This template can be overridden by copying it to yourtheme/woocommerce/emails/customer-invoice.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails * @version 10.4.0 */ use Automattic\WooCommerce\Enums\OrderStatus; use Automattic\WooCommerce\Utilities\FeaturesUtil; if ( ! defined( 'ABSPATH' ) ) { exit; } $email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' ); /** * Executes the e-mail header. * * @hooked WC_Emails::email_header() Output the email header */ do_action( 'woocommerce_email_header', $email_heading, $email ); ?> <?php echo $email_improvements_enabled ? '<div class="email-introduction">' : ''; ?> <p> <?php if ( ! empty( $order->get_billing_first_name() ) ) { /* translators: %s: Customer first name */ printf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_billing_first_name() ) ); } else { printf( esc_html__( 'Hi,', 'woocommerce' ) ); } ?> </p> <?php if ( $order->needs_payment() ) { ?> <p> <?php if ( $order->has_status( OrderStatus::FAILED ) ) { printf( wp_kses( /* translators: %1$s Site title, %2$s Order pay link */ __( 'Sorry, your order on %1$s was unsuccessful. Your order details are below, with a link to try your payment again: %2$s', 'woocommerce' ), array( 'a' => array( 'href' => array(), ), ) ), esc_html( get_bloginfo( 'name', 'display' ) ), '<a href="' . esc_url( $order->get_checkout_payment_url() ) . '">' . esc_html__( 'Pay for this order', 'woocommerce' ) . '</a>' ); } else { printf( wp_kses( /* translators: %1$s Site title, %2$s Order pay link */ __( 'An order has been created for you on %1$s. Your order details are below, with a link to make payment when you’re ready: %2$s', 'woocommerce' ), array( 'a' => array( 'href' => array(), ), ) ), esc_html( get_bloginfo( 'name', 'display' ) ), '<a href="' . esc_url( $order->get_checkout_payment_url() ) . '">' . esc_html__( 'Pay for this order', 'woocommerce' ) . '</a>' ); } ?> </p> <?php } else { ?> <p> <?php /* translators: %s Order date */ printf( esc_html__( 'Here are the details of your order placed on %s:', 'woocommerce' ), esc_html( wc_format_datetime( $order->get_date_created() ) ) ); ?> </p> <?php } ?> <?php echo $email_improvements_enabled ? '</div>' : ''; ?> <?php /** * Hook for the woocommerce_email_order_details. * * @hooked WC_Emails::order_details() Shows the order details table. * @hooked WC_Structured_Data::generate_order_data() Generates structured data. * @hooked WC_Structured_Data::output_structured_data() Outputs structured data. * @since 2.5.0 */ do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email ); /** * Hook for the woocommerce_email_order_meta. * * @hooked WC_Emails::order_meta() Shows order meta data. */ do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email ); /** * Hook for woocommerce_email_customer_details. * * @hooked WC_Emails::customer_details() Shows customer details * @hooked WC_Emails::email_address() Shows email address */ do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email ); /** * Show user-defined additional content - this is set in each email's settings. */ if ( $additional_content ) { echo $email_improvements_enabled ? '<table border="0" cellpadding="0" cellspacing="0" width="100%" role="presentation"><tr><td class="email-additional-content">' : ''; echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) ); echo $email_improvements_enabled ? '</td></tr></table>' : ''; } /** * Executes the email footer. * * @hooked WC_Emails::email_footer() Output the email footer */ do_action( 'woocommerce_email_footer', $email ); email-mobile-messaging.php 0000777 00000001451 15253050367 0011602 0 ustar 00 <?php /** * Email mobile messaging * * This template can be overridden by copying it to yourtheme/woocommerce/emails/email-mobile-messaging.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails * @version 7.0 */ use Automattic\WooCommerce\Internal\Orders\MobileMessagingHandler; echo wp_kses_post( MobileMessagingHandler::prepare_mobile_message( $order, $blog_id, $now, $domain ) ); customer-on-hold-order.php 0000777 00000006050 15253050367 0011603 0 ustar 00 <?php /** * Customer on-hold order email * * This template can be overridden by copying it to yourtheme/woocommerce/emails/customer-on-hold-order.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails * @version 10.4.0 */ use Automattic\WooCommerce\Utilities\FeaturesUtil; defined( 'ABSPATH' ) || exit; $email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' ); /* * @hooked WC_Emails::email_header() Output the email header */ do_action( 'woocommerce_email_header', $email_heading, $email ); ?> <?php echo $email_improvements_enabled ? '<div class="email-introduction">' : ''; ?> <p> <?php if ( ! empty( $order->get_billing_first_name() ) ) { /* translators: %s: Customer first name */ printf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_billing_first_name() ) ); } else { printf( esc_html__( 'Hi,', 'woocommerce' ) ); } ?> </p> <?php if ( $email_improvements_enabled ) : ?> <p><?php esc_html_e( 'We’ve received your order and it’s currently on hold until we can confirm your payment has been processed.', 'woocommerce' ); ?></p> <p><?php esc_html_e( 'Here’s a reminder of what you’ve ordered:', 'woocommerce' ); ?></p> <?php else : ?> <p><?php esc_html_e( 'Thanks for your order. It’s on-hold until we confirm that payment has been received.', 'woocommerce' ); ?></p> <?php endif; ?> <?php echo $email_improvements_enabled ? '</div>' : ''; ?> <?php /* * @hooked WC_Emails::order_details() Shows the order details table. * @hooked WC_Structured_Data::generate_order_data() Generates structured data. * @hooked WC_Structured_Data::output_structured_data() Outputs structured data. * @since 2.5.0 */ do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email ); /* * @hooked WC_Emails::order_meta() Shows order meta data. */ do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email ); /* * @hooked WC_Emails::customer_details() Shows customer details * @hooked WC_Emails::email_address() Shows email address */ do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email ); /** * Show user-defined additional content - this is set in each email's settings. */ if ( $additional_content ) { echo $email_improvements_enabled ? '<table border="0" cellpadding="0" cellspacing="0" width="100%" role="presentation"><tr><td class="email-additional-content">' : ''; echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) ); echo $email_improvements_enabled ? '</td></tr></table>' : ''; } /* * @hooked WC_Emails::email_footer() Output the email footer */ do_action( 'woocommerce_email_footer', $email ); customer-stock-notification-verify.php 0000777 00000005725 15253050367 0014253 0 ustar 00 <?php /** * Customer back-in-stock notification confirmation email. * * This template can be overridden by copying it to yourtheme/woocommerce/emails/customer-stock-notification-verify.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails * @version 10.2.0 */ // Exit if accessed directly. if ( ! defined( 'ABSPATH' ) ) { exit; } /** * Hook: woocommerce_email_header. * * @since 10.2.0 * * @hooked WC_Emails::email_header() Output the email header */ do_action( 'woocommerce_email_header', $email_heading, $email ); ?> <table border="0" cellpadding="0" cellspacing="0" id="notification__container"><tr><td> <div id="notification__into_content"> <?php echo wp_kses_post( wpautop( wptexturize( $intro_content ) ) ); ?> </div> <div id="notification__product"> <?php /** * Hook: woocommerce_email_stock_notification_product. * * @since 10.2.0 * * @hooked \Automattic\WooCommerce\Internal\StockNotifications\Templates::email_product_image - 10 * @hooked \Automattic\WooCommerce\Internal\StockNotifications\Templates::email_product_title - 20 * @hooked \Automattic\WooCommerce\Internal\StockNotifications\Templates::email_product_attributes - 30 * @hooked \Automattic\WooCommerce\Internal\StockNotifications\Templates::email_product_price - 40 */ do_action( 'woocommerce_email_stock_notification_product', $product, $notification, $plain_text, $email ); ?> <a href="<?php echo esc_url( $verification_link ); ?>" id="notification__action_button"><?php echo esc_html( $verification_button_text ); ?></a> <div id="notification__verification_expiration"> <?php // translators: %$s placeholder is the verification expiration datetime string. echo wp_kses_post( sprintf( esc_html__( 'This link will remain active for %s.', 'woocommerce' ), $verification_expiration_threshold ) ); ?> </div> </div> <table id="notification__footer"><tr><td> <?php echo esc_html( __( 'You have received this message because your e-mail address was used to sign up for stock notifications on our store. Wasn\'t you? Please get in touch with us if you keep receiving these messages.', 'woocommerce' ) ); ?> <br><br> <?php /** * Show user-defined additional content - this is set in each email's settings. */ if ( $additional_content ) { echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) ); } ?> </td></tr></table> </td></tr></table> <?php /** * Hook: woocommerce_email_footer. * * @since 10.2.0 * * @hooked WC_Emails::email_footer() Output the email footer */ do_action( 'woocommerce_email_footer', $email ); plain/email-fulfillment-items.php 0000777 00000004565 15253050367 0013134 0 ustar 00 <?php /** * Email Fulfillment Items (plain) * * This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/email-fulfillment-items.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails\Plain * @version 10.1.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } foreach ( $items as $item_id => $item ) : /** * Email Order Item Visibility hook. * * @since 2.5.0 * @param $visible Whether the item is visible in the email. * @param WC_Order_Item_Product $item The order item object. * * @return bool */ if ( apply_filters( 'woocommerce_order_item_visible', true, $item->item ) ) { $product = $item->item->get_product(); $sku = ''; $purchase_note = ''; if ( is_object( $product ) ) { $sku = $product->get_sku(); $purchase_note = $product->get_purchase_note(); } /** * Email Order Item Name hook. * * @since 2.1.0 * @since 2.4.0 Added $is_visible parameter. * @param string $product_name Product name. * @param WC_Order_Item $item Order item object. * @param bool $is_visible Is item visible. */ $product_name = apply_filters( 'woocommerce_order_item_name', $item->item->get_name(), $item->item, false ); /** * Email Order Item Quantity hook. * * @since 2.4.0 * @param int $quantity Item quantity. * @param WC_Order_Item $item Item object. */ $product_name .= ' × ' . apply_filters( 'woocommerce_email_order_item_quantity', $item->qty, $item->item ); echo wp_kses_post( str_pad( wp_kses_post( $product_name ), 40 ) ); echo ' '; echo esc_html( str_pad( wp_kses( $order->get_formatted_line_subtotal( $item->item ), array() ), 20, ' ', STR_PAD_LEFT ) ) . "\n"; // SKU. if ( $show_sku && $sku ) { echo esc_html( '(#' . $sku . ")\n" ); } } // Note. if ( $show_purchase_note && $purchase_note ) { echo "\n" . do_shortcode( wp_kses_post( $purchase_note ) ); } endforeach; plain/email-customer-details.php 0000777 00000001774 15253050367 0012757 0 ustar 00 <?php /** * Additional Customer Details (plain) * * This is extra customer data which can be filtered by plugins. It outputs below the order item table. * * This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/email-customer-details.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails\Plain * @version 3.4.0 */ defined( 'ABSPATH' ) || exit; echo esc_html( wc_strtoupper( esc_html__( 'Customer details', 'woocommerce' ) ) ) . "\n\n"; foreach ( $fields as $field ) { echo wp_kses_post( $field['label'] ) . ': ' . wp_kses_post( $field['value'] ) . "\n"; } plain/customer-refunded-order.php 0000777 00000006370 15253050367 0013147 0 ustar 00 <?php /** * Customer refunded order email (plain text) * * This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/customer-refunded-order.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails\Plain * @version 9.8.0 */ use Automattic\WooCommerce\Utilities\FeaturesUtil; defined( 'ABSPATH' ) || exit; $email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' ); echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n"; echo esc_html( wp_strip_all_tags( $email_heading ) ); echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n"; /* translators: %s: Customer first name */ echo sprintf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_billing_first_name() ) ) . "\n\n"; if ( $email_improvements_enabled ) { if ( $partial_refund ) { /* translators: %s: Site title */ echo sprintf( esc_html__( 'Your order from %s has been partially refunded.', 'woocommerce' ), esc_html( $blogname ) ) . "\n\n"; } else { /* translators: %s: Site title */ echo sprintf( esc_html__( 'Your order from %s has been refunded.', 'woocommerce' ), esc_html( $blogname ) ) . "\n\n"; } echo esc_html__( 'Here’s a reminder of what you’ve ordered:', 'woocommerce' ) . "\n\n"; } elseif ( $partial_refund ) { /* translators: %s: Site title */ echo sprintf( esc_html__( 'Your order on %s has been partially refunded. There are more details below for your reference:', 'woocommerce' ), esc_html( $blogname ) ) . "\n\n"; } else { /* translators: %s: Site title */ echo sprintf( esc_html__( 'Your order on %s has been refunded. There are more details below for your reference:', 'woocommerce' ), esc_html( $blogname ) ) . "\n\n"; } /* * @hooked WC_Emails::order_details() Shows the order details table. * @hooked WC_Structured_Data::generate_order_data() Generates structured data. * @hooked WC_Structured_Data::output_structured_data() Outputs structured data. * @since 2.5.0 */ do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email ); echo "\n----------------------------------------\n\n"; /* * @hooked WC_Emails::order_meta() Shows order meta data. */ do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email ); /* * @hooked WC_Emails::customer_details() Shows customer details * @hooked WC_Emails::email_address() Shows email address */ do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email ); echo "\n\n----------------------------------------\n\n"; /** * Show user-defined additional content - this is set in each email's settings. */ if ( $additional_content ) { echo esc_html( wp_strip_all_tags( wptexturize( $additional_content ) ) ); echo "\n\n----------------------------------------\n\n"; } echo wp_kses_post( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) ); plain/admin-failed-order.php 0000777 00000005274 15253050367 0012030 0 ustar 00 <?php /** * Admin failed order email (plain text) * * This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/admin-failed-order.php * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails\Plain * @version 9.8.0 */ use Automattic\WooCommerce\Utilities\FeaturesUtil; defined( 'ABSPATH' ) || exit; $email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' ); echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n"; echo esc_html( wp_strip_all_tags( $email_heading ) ); echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n"; /* translators: %1$s: Order number. %2$s: Customer full name. */ $text = __( 'Payment for order #%1$s from %2$s has failed. The order was as follows:', 'woocommerce' ); if ( $email_improvements_enabled ) { /* translators: %1$s: Order number. %2$s: Customer full name. */ $text = __( 'Unfortunately, the payment for order #%1$s from %2$s has failed. The order was as follows:', 'woocommerce' ); } echo sprintf( esc_html( $text ), esc_html( $order->get_order_number() ), esc_html( $order->get_formatted_billing_full_name() ) ) . "\n\n"; /* * @hooked WC_Emails::order_details() Shows the order details table. * @hooked WC_Structured_Data::generate_order_data() Generates structured data. * @hooked WC_Structured_Data::output_structured_data() Outputs structured data. * @since 2.5.0 */ do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email ); echo "\n----------------------------------------\n\n"; /* * @hooked WC_Emails::order_meta() Shows order meta data. */ do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email ); /* * @hooked WC_Emails::customer_details() Shows customer details * @hooked WC_Emails::email_address() Shows email address */ do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email ); echo "\n\n----------------------------------------\n\n"; /** * Show user-defined additional content - this is set in each email's settings. */ if ( $additional_content ) { echo esc_html( wp_strip_all_tags( wptexturize( $additional_content ) ) ); echo "\n\n----------------------------------------\n\n"; } echo wp_kses_post( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) ); plain/admin-new-order.php 0000777 00000005045 15253050367 0011371 0 ustar 00 <?php /** * Admin new order email (plain text) * * This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/admin-new-order.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails\Plain * @version 10.0.0 */ use Automattic\WooCommerce\Utilities\FeaturesUtil; defined( 'ABSPATH' ) || exit; $email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' ); echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n"; echo esc_html( wp_strip_all_tags( $email_heading ) ); echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n"; /* translators: %s: Customer billing full name */ $text = __( 'You’ve received the following order from %s:', 'woocommerce' ); if ( $email_improvements_enabled ) { /* translators: %s: Customer billing full name */ $text = __( 'You’ve received a new order from %s:', 'woocommerce' ); } echo sprintf( esc_html( $text ), esc_html( $order->get_formatted_billing_full_name() ) ) . "\n\n"; /* * @hooked WC_Emails::order_details() Shows the order details table. * @hooked WC_Structured_Data::generate_order_data() Generates structured data. * @hooked WC_Structured_Data::output_structured_data() Outputs structured data. * @since 2.5.0 */ do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email ); echo "\n----------------------------------------\n\n"; /* * @hooked WC_Emails::order_meta() Shows order meta data. */ do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email ); /* * @hooked WC_Emails::customer_details() Shows customer details * @hooked WC_Emails::email_address() Shows email address */ do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email ); echo "\n\n----------------------------------------\n\n"; /** * Show user-defined additional content - this is set in each email's settings. */ if ( $additional_content ) { echo esc_html( wp_strip_all_tags( wptexturize( $additional_content ) ) ); echo "\n\n----------------------------------------\n\n"; } echo wp_kses_post( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) ); plain/customer-new-account.php 0000777 00000005602 15253050367 0012462 0 ustar 00 <?php /** * Customer new account email * * This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/customer-new-account.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails\Plain * @version 10.0.0 */ use Automattic\WooCommerce\Utilities\FeaturesUtil; defined( 'ABSPATH' ) || exit; $email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' ); echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n"; echo esc_html( wp_strip_all_tags( $email_heading ) ); echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n"; /* translators: %s: Customer username */ echo sprintf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $user_login ) ) . "\n\n"; if ( $email_improvements_enabled ) { /* translators: %s: Site title */ echo sprintf( esc_html__( 'Thanks for creating an account on %s. Here’s a copy of your user details.', 'woocommerce' ), esc_html( $blogname ) ) . "\n\n"; echo "----------------------------------------\n\n"; /* translators: %s: Username */ echo sprintf( esc_html__( 'Username: %s.', 'woocommerce' ), esc_html( $user_login ) ) . "\n\n"; echo "----------------------------------------\n\n"; echo esc_html__( 'You can access your account area to view orders, change your password, and more via the link below:', 'woocommerce' ) . "\n\n"; echo esc_html( wc_get_page_permalink( 'myaccount' ) ) . "\n\n"; } else { /* translators: %1$s: Site title, %2$s: Username, %3$s: My account link */ echo sprintf( esc_html__( 'Thanks for creating an account on %1$s. Your username is %2$s. You can access your account area to view orders, change your password, and more at: %3$s', 'woocommerce' ), esc_html( $blogname ), esc_html( $user_login ), esc_html( wc_get_page_permalink( 'myaccount' ) ) ) . "\n\n"; } // Only send the set new password link if the user hasn't set their password during sign-up. if ( $password_generated && $set_password_url ) { /* translators: URL follows */ echo esc_html__( 'To set your password, visit the following address: ', 'woocommerce' ) . "\n\n"; echo esc_html( $set_password_url ) . "\n\n"; } echo "\n\n----------------------------------------\n\n"; /** * Show user-defined additional content - this is set in each email's settings. */ if ( $additional_content ) { echo esc_html( wp_strip_all_tags( wptexturize( $additional_content ) ) ); echo "\n\n----------------------------------------\n\n"; } echo wp_kses_post( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) ); plain/customer-stock-notification-verified.php 0000777 00000003431 15253050367 0015637 0 ustar 00 <?php /** * Customer Stock Notification Confirm template. * * This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/customer-stock-notification-verified.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails\Plain * @version 10.2.0 */ // Exit if accessed directly. if ( ! defined( 'ABSPATH' ) ) { exit; } echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n"; echo esc_html( wp_strip_all_tags( $email_heading ) ); echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n"; echo esc_html( wp_strip_all_tags( wptexturize( apply_filters( 'woocommerce_email_intro_content', $intro_content, $notification ) ) ) ); // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingHookComment echo "\n\n----------------------------------------\n\n"; /** * Hook: woocommerce_email_stock_notification_product. * * @since 10.2.0 */ do_action( 'woocommerce_email_stock_notification_product', $product, $notification, true, $email ); /** * Show user-defined additional content - this is set in each email's settings. */ if ( $additional_content ) { echo esc_html( wp_strip_all_tags( wptexturize( $additional_content ) ) ); echo "\n\n----------------------------------------\n\n"; } echo wp_kses_post( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) ); // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingHookComment plain/customer-fulfillment-created.php 0000777 00000004740 15253050367 0014167 0 ustar 00 <?php /** * Customer fulfillment created email (plain text) * * This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/customer-fulfillment-created.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails\Plain * @version 10.1.0 */ defined( 'ABSPATH' ) || exit; echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n"; echo esc_html( wp_strip_all_tags( $email_heading ) ); echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n"; echo esc_html__( 'Woo! Some items you purchased are being fulfilled. You can use the below information to track your shipment:', 'woocommerce' ) . "\n\n"; /** * Display fulfillment details. * * @hooked WC_Emails::fulfillment_details() Shows the order details table. * @hooked WC_Structured_Data::generate_order_data() Generates structured data. * @hooked WC_Structured_Data::output_structured_data() Outputs structured data. * * @since 10.1.0 */ do_action( 'woocommerce_email_fulfillment_details', $order, $fulfillment, $sent_to_admin, $plain_text, $email ); echo "\n----------------------------------------\n\n"; /** * Display fulfillment meta data. * * @hooked WC_Emails::fulfillment_meta() Shows order meta data. * * @since 10.1.0 */ do_action( 'woocommerce_email_fulfillment_meta', $order, $fulfillment, $sent_to_admin, $plain_text, $email ); /** * Display customer details and email address. * * @hooked WC_Emails::customer_details() Shows customer details * @hooked WC_Emails::email_address() Shows email address * * @since 2.5.0 */ do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email ); echo "\n\n----------------------------------------\n\n"; /** * Show user-defined additional content - this is set in each email's settings. */ if ( $additional_content ) { echo esc_html( wp_strip_all_tags( wptexturize( $additional_content ) ) ); echo "\n\n----------------------------------------\n\n"; } /** * Display the email footer text. * * @since 2.5.0 */ echo wp_kses_post( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) ); plain/customer-failed-order.php 0000777 00000005541 15253050367 0012576 0 ustar 00 <?php /** * Customer failed order email (plain text) * * This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/customer-failed-order.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails\Plain * @version 9.8.0 */ defined( 'ABSPATH' ) || exit; echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n"; echo esc_html( wp_strip_all_tags( $email_heading ) ); echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n"; /* translators: %s: Customer first name */ echo sprintf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_billing_first_name() ) ) . "\n\n"; echo esc_html__( "Unfortunately, we couldn't complete your order due to an issue with your payment method.", 'woocommerce' ) . "\n\n"; /* translators: %s: Site title */ echo sprintf( esc_html__( "If you'd like to continue with your purchase, please return to %s and try a different method of payment.", 'woocommerce' ), esc_html( $blogname ) ) . "\n\n"; echo esc_html__( 'Your order details are as follows:', 'woocommerce' ) . "\n\n"; /** * Hook for the woocommerce_email_order_details. * * @hooked WC_Emails::order_details() Shows the order details table. * @hooked WC_Structured_Data::generate_order_data() Generates structured data. * @hooked WC_Structured_Data::output_structured_data() Outputs structured data. * @since 2.5.0 */ do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email ); echo "\n----------------------------------------\n\n"; /** * Hook for the woocommerce_email_order_meta. * * @hooked WC_Emails::order_meta() Shows order meta data. * @since 1.0.0 */ do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email ); /** * Hook for woocommerce_email_customer_details. * * @hooked WC_Emails::customer_details() Shows customer details * @hooked WC_Emails::email_address() Shows email address * @since 1.0.0 */ do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email ); echo "\n\n----------------------------------------\n\n"; /** * Show user-defined additional content - this is set in each email's settings. */ if ( $additional_content ) { echo esc_html( wp_strip_all_tags( wptexturize( $additional_content ) ) ); echo "\n\n----------------------------------------\n\n"; } /** * Filters the email footer text. * * @since 3.7.0 */ echo wp_kses_post( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) ); plain/customer-stock-notification.php 0000777 00000003410 15253050367 0014041 0 ustar 00 <?php /** * Customer Stock Notification template. * * This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/customer-stock-notification.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails\Plain * @version 10.2.0 */ // Exit if accessed directly. if ( ! defined( 'ABSPATH' ) ) { exit; } echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n"; echo esc_html( wp_strip_all_tags( $email_heading ) ); echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n"; echo esc_html( wp_strip_all_tags( wptexturize( apply_filters( 'woocommerce_email_intro_content', $intro_content, $notification ) ) ) ); // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingHookComment echo "\n\n----------------------------------------\n\n"; /** * Hook: woocommerce_email_stock_notification_product. * * @since 10.2.0 */ do_action( 'woocommerce_email_stock_notification_product', $product, $notification, true, $email ); /** * Show user-defined additional content - this is set in each email's settings. */ if ( $additional_content ) { echo esc_html( wp_strip_all_tags( wptexturize( $additional_content ) ) ); echo "\n\n----------------------------------------\n\n"; } echo wp_kses_post( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) ); // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingHookComment plain/customer-fulfillment-deleted.php 0000777 00000005211 15253050367 0014160 0 ustar 00 <?php /** * Customer fulfillment deleted email (plain text) * * This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/customer-fulfillment-deleted.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails\Plain * @version 10.1.0 */ defined( 'ABSPATH' ) || exit; echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n"; echo esc_html( wp_strip_all_tags( $email_heading ) ); echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n"; echo esc_html__( 'We wanted to let you know that one of the previously fulfilled shipments from your order has been removed from our system. This may have been due to a correction or an update in our fulfillment records. Don’t worry — this won’t affect any items you’ve already received.', 'woocommerce' ) . "\n\n"; /** * Display fulfillment details. * * @hooked WC_Emails::fulfillment_details() Shows the order details table. * @hooked WC_Structured_Data::generate_order_data() Generates structured data. * @hooked WC_Structured_Data::output_structured_data() Outputs structured data. * * @since 10.1.0 */ do_action( 'woocommerce_email_fulfillment_details', $order, $fulfillment, $sent_to_admin, $plain_text, $email ); echo "\n----------------------------------------\n\n"; /** * Display fulfillment meta data. * * @hooked WC_Emails::fulfillment_meta() Shows order meta data. * * @since 10.1.0 */ do_action( 'woocommerce_email_fulfillment_meta', $order, $fulfillment, $sent_to_admin, $plain_text, $email ); /** * Display customer details and email address. * * @hooked WC_Emails::customer_details() Shows customer details * @hooked WC_Emails::email_address() Shows email address * * @since 2.5.0 */ do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email ); echo "\n\n----------------------------------------\n\n"; /** * Show user-defined additional content - this is set in each email's settings. */ if ( $additional_content ) { echo esc_html( wp_strip_all_tags( wptexturize( $additional_content ) ) ); echo "\n\n----------------------------------------\n\n"; } /** * Display the email footer text. * * @since 2.5.0 */ echo wp_kses_post( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) ); plain/customer-fulfillment-updated.php 0000777 00000005162 15253050367 0014205 0 ustar 00 <?php /** * Customer fulfillment updated email (plain text) * * This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/customer-fulfillment-updated.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails\Plain * @version 10.1.0 */ defined( 'ABSPATH' ) || exit; echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n"; echo esc_html( wp_strip_all_tags( $email_heading ) ); echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n"; /* translators: %s: Customer first name */ echo esc_html__( 'Some details of your shipment have recently been updated. This may include tracking information, item contents, or delivery status.', 'woocommerce' ) . "\n\n"; echo esc_html__( 'Here’s the latest info we have:', 'woocommerce' ) . "\n\n"; /** * Display fulfillment details. * * @hooked WC_Emails::fulfillment_details() Shows the order details table. * @hooked WC_Structured_Data::generate_order_data() Generates structured data. * @hooked WC_Structured_Data::output_structured_data() Outputs structured data. * * @since 10.1.0 */ do_action( 'woocommerce_email_fulfillment_details', $order, $fulfillment, $sent_to_admin, $plain_text, $email ); echo "\n----------------------------------------\n\n"; /** * Display fulfillment meta data. * * @hooked WC_Emails::fulfillment_meta() Shows order meta data. * * @since 10.1.0 */ do_action( 'woocommerce_email_fulfillment_meta', $order, $fulfillment, $sent_to_admin, $plain_text, $email ); /** * Display customer details and email address. * * @hooked WC_Emails::customer_details() Shows customer details * @hooked WC_Emails::email_address() Shows email address * * @since 2.5.0 */ do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email ); echo "\n\n----------------------------------------\n\n"; /** * Show user-defined additional content - this is set in each email's settings. */ if ( $additional_content ) { echo esc_html( wp_strip_all_tags( wptexturize( $additional_content ) ) ); echo "\n\n----------------------------------------\n\n"; } /** * Display the email footer text. * * @since 2.5.0 */ echo wp_kses_post( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) ); plain/customer-reset-password.php 0000777 00000005152 15253050367 0013221 0 ustar 00 <?php /** * Customer Reset Password email * * This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/customer-reset-password.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails\Plain * @version 9.8.0 */ use Automattic\WooCommerce\Utilities\FeaturesUtil; defined( 'ABSPATH' ) || exit; $email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' ); echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n"; echo esc_html( wp_strip_all_tags( $email_heading ) ); echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n"; /* translators: %s: Customer username */ echo sprintf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $user_login ) ) . "\n\n"; /* translators: %s: Store name */ echo sprintf( esc_html__( 'Someone has requested a new password for the following account on %s:', 'woocommerce' ), esc_html( $blogname ) ) . "\n\n"; if ( $email_improvements_enabled ) { echo "----------------------------------------\n\n"; } /* translators: %s: Customer username */ echo sprintf( esc_html__( 'Username: %s', 'woocommerce' ), esc_html( $user_login ) ) . "\n\n"; if ( $email_improvements_enabled ) { echo "----------------------------------------\n\n"; echo esc_html__( 'If you didn’t make this request, just ignore this email. If you’d like to proceed, reset your password via the link below:', 'woocommerce' ) . "\n\n"; } else { echo esc_html__( 'If you didn\'t make this request, just ignore this email. If you\'d like to proceed:', 'woocommerce' ) . "\n\n"; } echo esc_url( add_query_arg( array( 'key' => $reset_key, 'id' => $user_id, 'login' => rawurlencode( $user_login ) ), wc_get_endpoint_url( 'lost-password', '', wc_get_page_permalink( 'myaccount' ) ) ) ) . "\n\n"; // phpcs:ignore WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound echo "\n\n----------------------------------------\n\n"; /** * Show user-defined additional content - this is set in each email's settings. */ if ( $additional_content ) { echo esc_html( wp_strip_all_tags( wptexturize( $additional_content ) ) ); echo "\n\n----------------------------------------\n\n"; } echo wp_kses_post( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) ); plain/customer-cancelled-order.php 0000777 00000005465 15253050367 0013271 0 ustar 00 <?php /** * Customer cancelled order email (plain text) * * This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/customer-cancelled-order.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails\Plain * @version 10.0.0 */ use Automattic\WooCommerce\Utilities\FeaturesUtil; defined( 'ABSPATH' ) || exit; $email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' ); echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n"; echo esc_html( wp_strip_all_tags( $email_heading ) ); echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n"; /* translators: %1$s: Order number */ $text = __( 'We’re sorry to let you know that your order #%1$s has been cancelled.', 'woocommerce' ); if ( $email_improvements_enabled ) { /* translators: %1$s: Order number */ $text = __( 'We’re getting in touch to let you know that your order #%1$s has been cancelled.', 'woocommerce' ); } echo sprintf( esc_html( $text ), esc_html( $order->get_order_number() ) ) . "\n\n"; /** * Hook: woocommerce_email_order_details. * * @hooked WC_Emails::order_details() Shows the order details table. * @hooked WC_Structured_Data::generate_order_data() Generates structured data. * @hooked WC_Structured_Data::output_structured_data() Outputs structured data. * @since 2.5.0 */ do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email ); echo "\n----------------------------------------\n\n"; /** * Hook: woocommerce_email_order_meta. * * @hooked WC_Emails::order_meta() Shows order meta data. * @since 2.5.0 */ do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email ); /** * Hook: woocommerce_email_customer_details. * * @hooked WC_Emails::customer_details() Shows customer details * @hooked WC_Emails::email_address() Shows email address * @since 2.5.0 */ do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email ); echo "\n\n----------------------------------------\n\n"; /** * Show user-defined additional content - this is set in each email's settings. */ if ( $additional_content ) { echo esc_html( wp_strip_all_tags( wptexturize( $additional_content ) ) ); echo "\n\n----------------------------------------\n\n"; } /** * Hook: woocommerce_email_footer. * * @hooked WC_Emails::email_footer() Output the email footer * @since 2.5.0 */ do_action( 'woocommerce_email_footer', $email ); plain/customer-pos-refunded-order.php 0000777 00000010205 15253050367 0013736 0 ustar 00 <?php /** * Customer POS refunded order email (plain text) * * This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/customer-pos-refunded-order.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails\Plain * @version 10.0.0 */ use Automattic\WooCommerce\Utilities\FeaturesUtil; defined( 'ABSPATH' ) || exit; $email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' ); $email = $email ?? null; echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n"; echo esc_html( wp_strip_all_tags( $email_heading ) ); echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n"; if ( ! empty( $order->get_billing_first_name() ) ) { /* translators: %s: Customer first name */ echo sprintf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_billing_first_name() ) ) . "\n\n"; } else { echo esc_html__( 'Hi there,', 'woocommerce' ) . "\n\n"; } if ( $partial_refund ) { /* translators: %s: Site title */ echo sprintf( esc_html__( 'Your order from %s has been partially refunded.', 'woocommerce' ), esc_html( $pos_store_name ) ) . "\n\n"; } else { /* translators: %s: Site title */ echo sprintf( esc_html__( 'Your order from %s has been refunded.', 'woocommerce' ), esc_html( $pos_store_name ) ) . "\n\n"; } echo esc_html__( 'Here’s a reminder of what you’ve bought:', 'woocommerce' ) . "\n\n"; /** * Show order details. * * @hooked WC_Emails::order_details() Shows the order details table. * @hooked WC_Structured_Data::generate_order_data() Generates structured data. * @hooked WC_Structured_Data::output_structured_data() Outputs structured data. * @since 2.5.0 */ do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email ); echo "\n----------------------------------------\n\n"; /** * Show order meta data. * * @hooked WC_Emails::order_meta() Shows order meta data. * @since 1.0.0 */ do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email ); /** * Show customer details and email address. * * @hooked WC_Emails::customer_details() Shows customer details * @hooked WC_Emails::email_address() Shows email address * @since 1.0.0 */ do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email ); echo "\n\n----------------------------------------\n\n"; /** * Show user-defined additional content - this is set in each email's settings. */ if ( $additional_content ) { echo esc_html( wp_strip_all_tags( wptexturize( $additional_content ) ) ); echo "\n\n----------------------------------------\n\n"; } /** * Show store information - store details are set in the Point of Sale settings. */ if ( ! empty( $pos_store_email ) || ! empty( $pos_store_phone_number ) || ! empty( $pos_store_address ) ) { if ( ! empty( $pos_store_name ) ) { echo "\n" . esc_html( $pos_store_name ) . "\n\n"; } if ( ! empty( $pos_store_email ) ) { echo esc_html( $pos_store_email ) . "\n"; } if ( ! empty( $pos_store_phone_number ) ) { echo esc_html( $pos_store_phone_number ) . "\n"; } if ( ! empty( $pos_store_address ) ) { echo esc_html( wp_strip_all_tags( wptexturize( $pos_store_address ) ) ) . "\n"; } echo "\n----------------------------------------\n\n"; } /** * Show refund & returns policy - this is set in the Point of Sale settings. */ if ( ! empty( $pos_refund_returns_policy ) ) { echo "\n" . esc_html__( 'Refund & Returns Policy', 'woocommerce' ) . "\n\n"; echo esc_html( wp_strip_all_tags( wptexturize( $pos_refund_returns_policy ) ) ) . "\n"; echo "\n----------------------------------------\n\n"; } /** * Filter the email footer text. * * @since 4.0.0 */ echo wp_kses_post( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ), $email ) ); plain/email-order-items.php 0000777 00000007527 15253050367 0011727 0 ustar 00 <?php /** * Email Order Items (plain) * * This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/email-order-items.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails\Plain * @version 9.8.0 */ use Automattic\WooCommerce\Utilities\FeaturesUtil; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } $email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' ); foreach ( $items as $item_id => $item ) : if ( apply_filters( 'woocommerce_order_item_visible', true, $item ) ) { $product = $item->get_product(); $sku = ''; $purchase_note = ''; if ( is_object( $product ) ) { $sku = $product->get_sku(); $purchase_note = $product->get_purchase_note(); } if ( $email_improvements_enabled ) { /** * Email Order Item Name hook. * * @since 2.1.0 * @since 2.4.0 Added $is_visible parameter. * @param string $product_name Product name. * @param WC_Order_Item $item Order item object. * @param bool $is_visible Is item visible. */ $product_name = apply_filters( 'woocommerce_order_item_name', $item->get_name(), $item, false ); /** * Email Order Item Quantity hook. * * @since 2.4.0 * @param int $quantity Item quantity. * @param WC_Order_Item $item Item object. */ $product_name .= ' × ' . apply_filters( 'woocommerce_email_order_item_quantity', $item->get_quantity(), $item ); echo wp_kses_post( str_pad( wp_kses_post( $product_name ), 40 ) ); echo ' '; echo esc_html( str_pad( wp_kses( $order->get_formatted_line_subtotal( $item ), array() ), 20, ' ', STR_PAD_LEFT ) ) . "\n"; if ( $show_sku && $sku ) { echo esc_html( '(#' . $sku . ")\n" ); } } else { // phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped /** * Email Order Item Name hook. * * @since 2.1.0 * @since 2.4.0 Added $is_visible parameter. * @param string $product_name Product name. * @param WC_Order_Item $item Order item object. * @param bool $is_visible Is item visible. */ echo wp_kses_post( apply_filters( 'woocommerce_order_item_name', $item->get_name(), $item, false ) ); if ( $show_sku && $sku ) { echo ' (#' . $sku . ')'; } /** * Email Order Item Quantity hook. * * @since 2.4.0 * @param int $quantity Item quantity. * @param WC_Order_Item $item Item object. */ echo ' X ' . apply_filters( 'woocommerce_email_order_item_quantity', $item->get_quantity(), $item ); echo ' = ' . $order->get_formatted_line_subtotal( $item ) . "\n"; // phpcs:enable WordPress.Security.EscapeOutput.OutputNotEscaped } // allow other plugins to add additional product information here. do_action( 'woocommerce_order_item_meta_start', $item_id, $item, $order, $plain_text ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo strip_tags( wc_display_item_meta( $item, array( 'before' => "\n- ", 'separator' => "\n- ", 'after' => '', 'echo' => false, 'autop' => false, ) ) ); // allow other plugins to add additional product information here. do_action( 'woocommerce_order_item_meta_end', $item_id, $item, $order, $plain_text ); } // Note. if ( $show_purchase_note && $purchase_note ) { echo "\n" . do_shortcode( wp_kses_post( $purchase_note ) ); } echo "\n\n"; endforeach; plain/customer-stock-notification-verify.php 0000777 00000003425 15253050367 0015351 0 ustar 00 <?php /** * Back in Stock Notification Verify template. * * This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/customer-stock-notification-verify.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails\Plain * @version 10.2.0 */ // Exit if accessed directly. if ( ! defined( 'ABSPATH' ) ) { exit; } echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n"; echo esc_html( wp_strip_all_tags( $email_heading ) ); echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n"; echo esc_html( wp_strip_all_tags( wptexturize( apply_filters( 'woocommerce_email_intro_content', $intro_content, $notification ) ) ) ); // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingHookComment echo "\n\n----------------------------------------\n\n"; /** * Hook: woocommerce_email_stock_notification_product. * * @since 10.2.0 */ do_action( 'woocommerce_email_stock_notification_product', $product, $notification, true, $email ); /** * Show user-defined additional content - this is set in each email's settings. */ if ( $additional_content ) { echo esc_html( wp_strip_all_tags( wptexturize( $additional_content ) ) ); echo "\n\n----------------------------------------\n\n"; } echo wp_kses_post( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) ); // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingHookComment plain/customer-processing-order.php 0000777 00000005466 15253050367 0013534 0 ustar 00 <?php /** * Customer processing order email * * This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/customer-processing-order.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails\Plain * @version 9.9.0 */ use Automattic\WooCommerce\Utilities\FeaturesUtil; defined( 'ABSPATH' ) || exit; $email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' ); echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n"; echo esc_html( wp_strip_all_tags( $email_heading ) ); echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n"; /* translators: %s: Customer first name */ echo sprintf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_billing_first_name() ) ) . "\n\n"; if ( $email_improvements_enabled ) { echo esc_html__( 'Just to let you know — we’ve received your order, and it is now being processed.', 'woocommerce' ) . "\n\n"; echo esc_html__( 'Here’s a reminder of what you’ve ordered:', 'woocommerce' ) . "\n\n"; } else { /* translators: %s: Order number */ echo sprintf( esc_html__( 'Just to let you know — we\'ve received your order #%s, and it is now being processed:', 'woocommerce' ), esc_html( $order->get_order_number() ) ) . "\n\n"; } /* * @hooked WC_Emails::order_details() Shows the order details table. * @hooked WC_Structured_Data::generate_order_data() Generates structured data. * @hooked WC_Structured_Data::output_structured_data() Outputs structured data. * @since 2.5.0 */ do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email ); echo "\n----------------------------------------\n\n"; /* * @hooked WC_Emails::order_meta() Shows order meta data. */ do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email ); /* * @hooked WC_Emails::customer_details() Shows customer details * @hooked WC_Emails::email_address() Shows email address */ do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email ); echo "\n\n----------------------------------------\n\n"; /** * Show user-defined additional content - this is set in each email's settings. */ if ( $additional_content ) { echo esc_html( wp_strip_all_tags( wptexturize( $additional_content ) ) ); echo "\n\n----------------------------------------\n\n"; } echo wp_kses_post( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) ); plain/email-order-details.php 0000777 00000006014 15253050367 0012221 0 ustar 00 <?php /** * Order details table shown in emails. * * This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/email-order-details.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails * @version 10.1.0 */ use Automattic\WooCommerce\Utilities\FeaturesUtil; defined( 'ABSPATH' ) || exit; $email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' ); if ( $email_improvements_enabled ) { add_filter( 'woocommerce_order_shipping_to_display_shipped_via', '__return_false' ); } do_action( 'woocommerce_email_before_order_table', $order, $sent_to_admin, $plain_text, $email ); if ( $email_improvements_enabled ) { /* translators: %1$s: Order ID. %2$s: Order date */ echo wp_kses_post( sprintf( esc_html__( 'Order #%1$s (%2$s)', 'woocommerce' ), $order->get_order_number(), wc_format_datetime( $order->get_date_created() ) ) ) . "\n"; echo "\n==========\n"; } else { /* translators: %1$s: Order ID. %2$s: Order date */ echo wp_kses_post( wc_strtoupper( sprintf( esc_html__( '[Order #%1$s] (%2$s)', 'woocommerce' ), $order->get_order_number(), wc_format_datetime( $order->get_date_created() ) ) ) ) . "\n"; } echo "\n" . wc_get_email_order_items( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped $order, array( 'show_sku' => $sent_to_admin, 'show_image' => false, 'image_size' => array( 32, 32 ), 'plain_text' => true, 'sent_to_admin' => $sent_to_admin, ) ); echo "==========\n\n"; $item_totals = $order->get_order_item_totals(); if ( $item_totals ) { foreach ( $item_totals as $total ) { if ( $email_improvements_enabled ) { $label = $total['label']; if ( isset( $total['meta'] ) ) { $label .= ' ' . $total['meta']; } echo wp_kses_post( str_pad( wp_kses_post( $label ), 40 ) ); echo ' '; echo esc_html( str_pad( wp_kses( $total['value'], array() ), 20, ' ', STR_PAD_LEFT ) ) . "\n"; } else { echo wp_kses_post( $total['label'] . "\t " . $total['value'] ) . "\n"; } } } if ( $order->get_customer_note() ) { if ( $email_improvements_enabled ) { echo "\n" . esc_html__( 'Note:', 'woocommerce' ) . "\n" . wp_kses( wc_wptexturize_order_note( $order->get_customer_note() ), array() ) . "\n"; } else { echo esc_html__( 'Note:', 'woocommerce' ) . "\t " . wp_kses( wc_wptexturize_order_note( $order->get_customer_note() ), array() ) . "\n"; } } if ( $sent_to_admin ) { /* translators: %s: Order link. */ echo "\n" . sprintf( esc_html__( 'View order: %s', 'woocommerce' ), esc_url( $order->get_edit_order_url() ) ) . "\n"; } do_action( 'woocommerce_email_after_order_table', $order, $sent_to_admin, $plain_text, $email ); plain/customer-invoice.php 0000777 00000007256 15253050367 0011702 0 ustar 00 <?php /** * Customer invoice email (plain text) * * This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/customer-invoice.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails\Plain * @version 9.7.0 */ // phpcs:disable Universal.WhiteSpace.PrecisionAlignment.Found, Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed -- Plain text output needs specific spacing without tabs use Automattic\WooCommerce\Enums\OrderStatus; defined( 'ABSPATH' ) || exit; echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n"; echo esc_html( wp_strip_all_tags( $email_heading ) ); echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n"; /* translators: %s: Customer first name */ echo sprintf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_billing_first_name() ) ) . "\n\n"; if ( $order->needs_payment() ) { if ( $order->has_status( OrderStatus::FAILED ) ) { echo wp_kses_post( sprintf( /* translators: %1$s: Site title, %2$s: Order pay link */ __( 'Sorry, your order on %1$s was unsuccessful. Your order details are below, with a link to try your payment again: %2$s', 'woocommerce' ), esc_html( get_bloginfo( 'name', 'display' ) ), esc_url( $order->get_checkout_payment_url() ) ) ) . "\n\n"; } else { echo wp_kses_post( sprintf( /* translators: %1$s: Site title, %2$s: Order pay link */ __( 'An order has been created for you on %1$s. Your order details are below, with a link to make payment when you’re ready: %2$s', 'woocommerce' ), esc_html( get_bloginfo( 'name', 'display' ) ), esc_url( $order->get_checkout_payment_url() ) ) ) . "\n\n"; } } else { /* translators: %s: Order date */ echo sprintf( esc_html__( 'Here are the details of your order placed on %s:', 'woocommerce' ), esc_html( wc_format_datetime( $order->get_date_created() ) ) ) . "\n\n"; } /** * Hook for the woocommerce_email_order_details. * * @hooked WC_Emails::order_details() Shows the order details table. * @hooked WC_Structured_Data::generate_order_data() Generates structured data. * @hooked WC_Structured_Data::output_structured_data() Outputs structured data. * @since 2.5.0 */ do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email ); echo "\n----------------------------------------\n\n"; /** * Hook for the woocommerce_email_order_meta. * * @hooked WC_Emails::order_meta() Shows order meta data. */ do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email ); /** * Hook for woocommerce_email_customer_details * * @hooked WC_Emails::customer_details() Shows customer details * @hooked WC_Emails::email_address() Shows email address */ do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email ); echo "\n\n----------------------------------------\n\n"; /** * Show user-defined additional content - this is set in each email's settings. */ if ( $additional_content ) { echo esc_html( wp_strip_all_tags( wptexturize( $additional_content ) ) ); echo "\n\n----------------------------------------\n\n"; } echo wp_kses_post( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) ); // phpcs:enable Universal.WhiteSpace.PrecisionAlignment.Found, Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed plain/email-fulfillment-details.php 0000777 00000006573 15253050367 0013441 0 ustar 00 <?php /** * Order fulfillment details table shown in emails as plain text. * * This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/email-fulfillment-details.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails\Plain * @version 10.1.0 */ defined( 'ABSPATH' ) || exit; if ( null === $fulfillment->get_date_deleted() ) { $tracking_number = $fulfillment->get_meta( '_tracking_number', true ); $tracking_url = $fulfillment->get_meta( '_tracking_url' ); $shipment_provider = $fulfillment->get_meta( '_shipment_provider' ); if ( ! $tracking_number && ! $tracking_url && ! $shipment_provider ) { echo esc_html__( 'No tracking information available for this fulfillment at the moment.', 'woocommerce' ); return; } else { echo esc_html__( 'Tracking Number', 'woocommerce' ) . ': ' . esc_attr( $tracking_number ) . "\n"; echo esc_html__( 'Shipment Provider', 'woocommerce' ) . ': ' . esc_html( $shipment_provider ) . "\n"; echo esc_html__( 'Tracking URL', 'woocommerce' ) . ': ' . esc_html( $tracking_url ) . "\n\n"; } echo esc_html__( 'You can access to more details of your order by visiting My Account > Orders and select the order you wish to see the latest status of the delivery.', 'woocommerce' ); echo "\n\n\n"; } /** * Action hook to add custom content before fulfillment details in email. * * @param WC_Order $order Order object. * @param Fulfillment $fulfillment Fulfillment object. * @param bool $sent_to_admin Whether it's sent to admin or customer. * @param bool $plain_text Whether it's a plain text email. * @param WC_Email $email Email object. * @since 2.5.0 */ do_action( 'woocommerce_email_before_fulfillment_table', $order, $fulfillment, $sent_to_admin, $plain_text, $email ); echo wp_kses_post( __( 'Fulfillment summary', 'woocommerce' ) ); echo "\n\n==========\n\n"; if ( $sent_to_admin ) { $before = ''; $after = '(' . esc_url( $order->get_edit_order_url() ) . ')'; } else { $before = ''; $after = ''; } /* translators: %s: Order ID. */ $order_number_string = __( 'Order #%s', 'woocommerce' ); echo wp_kses_post( $before . sprintf( $order_number_string . $after . ' (%s)', $order->get_order_number(), wc_format_datetime( $order->get_date_created() ) ) ); echo "\n\n\n"; echo wc_get_email_fulfillment_items( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped $order, $fulfillment, array( 'show_sku' => $sent_to_admin, 'show_image' => true, 'image_size' => array( 48, 48 ), 'plain_text' => $plain_text, 'sent_to_admin' => $sent_to_admin, ) ); /** * Action hook to add custom content after fulfillment details in email. * * @param WC_Order $order Order object. * @param bool $sent_to_admin Whether it's sent to admin or customer. * @param bool $plain_text Whether it's a plain text email. * @param WC_Email $email Email object. * @since 2.5.0 */ do_action( 'woocommerce_email_after_fulfillment_table', $order, $fulfillment, $sent_to_admin, $plain_text, $email ); plain/admin-cancelled-order.php 0000777 00000005315 15253050367 0012512 0 ustar 00 <?php /** * Admin cancelled order email (plain text) * * This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/admin-cancelled-order.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails\Plain * @version 9.8.0 */ use Automattic\WooCommerce\Utilities\FeaturesUtil; defined( 'ABSPATH' ) || exit; $email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' ); echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n"; echo esc_html( wp_strip_all_tags( $email_heading ) ); echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n"; /* translators: %1$s: Order number. %2$s: Customer full name */ $text = __( 'Notification to let you know — order #%1$s belonging to %2$s has been cancelled:', 'woocommerce' ); if ( $email_improvements_enabled ) { /* translators: %1$s: Order number. %2$s: Customer full name */ $text = __( 'We’re getting in touch to let you know that order #%1$s from %2$s has been cancelled.', 'woocommerce' ); } echo sprintf( esc_html( $text ), esc_html( $order->get_order_number() ), esc_html( $order->get_formatted_billing_full_name() ) ) . "\n\n"; /* * @hooked WC_Emails::order_details() Shows the order details table. * @hooked WC_Structured_Data::generate_order_data() Generates structured data. * @hooked WC_Structured_Data::output_structured_data() Outputs structured data. * @since 2.5.0 */ do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email ); echo "\n----------------------------------------\n\n"; /* * @hooked WC_Emails::order_meta() Shows order meta data. */ do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email ); /* * @hooked WC_Emails::customer_details() Shows customer details * @hooked WC_Emails::email_address() Shows email address */ do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email ); echo "\n\n----------------------------------------\n\n"; /** * Show user-defined additional content - this is set in each email's settings. */ if ( $additional_content ) { echo esc_html( wp_strip_all_tags( wptexturize( $additional_content ) ) ); echo "\n\n----------------------------------------\n\n"; } echo wp_kses_post( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) ); plain/customer-note.php 0000777 00000005001 15253050367 0011175 0 ustar 00 <?php /** * Customer note email * * This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/customer-note.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails\Plain * @version 10.1.0 */ defined( 'ABSPATH' ) || exit; echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n"; echo esc_html( wp_strip_all_tags( $email_heading ) ); echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n"; /* translators: %s: Customer first name */ echo sprintf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_billing_first_name() ) ) . "\n\n"; echo esc_html__( 'The following note has been added to your order:', 'woocommerce' ) . "\n\n"; echo "----------\n\n"; echo wc_wptexturize_order_note( $customer_note ) . "\n\n"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo "----------\n\n"; echo esc_html__( 'As a reminder, here are your order details:', 'woocommerce' ) . "\n\n"; /* * @hooked WC_Emails::order_details() Shows the order details table. * @hooked WC_Structured_Data::generate_order_data() Generates structured data. * @hooked WC_Structured_Data::output_structured_data() Outputs structured data. * @since 2.5.0 */ do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email ); echo "\n----------------------------------------\n\n"; /* * @hooked WC_Emails::order_meta() Shows order meta data. */ do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email ); /* * @hooked WC_Emails::customer_details() Shows customer details * @hooked WC_Emails::email_address() Shows email address */ do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email ); echo "\n\n----------------------------------------\n\n"; /** * Show user-defined additional content - this is set in each email's settings. */ if ( $additional_content ) { echo esc_html( wp_strip_all_tags( wptexturize( $additional_content ) ) ); echo "\n\n----------------------------------------\n\n"; } echo wp_kses_post( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) ); plain/customer-pos-completed-order.php 0000777 00000007511 15253050367 0014124 0 ustar 00 <?php /** * Customer POS completed order email (plain text) * * This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/customer-pos-completed-order.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails\Plain * @version 10.0.0 */ use Automattic\WooCommerce\Utilities\FeaturesUtil; defined( 'ABSPATH' ) || exit; $email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' ); $email = $email ?? null; echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n"; echo esc_html( wp_strip_all_tags( $email_heading ) ); echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n"; if ( ! empty( $order->get_billing_first_name() ) ) { /* translators: %s: Customer first name */ echo sprintf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_billing_first_name() ) ) . "\n\n"; } else { echo esc_html__( 'Hi there,', 'woocommerce' ) . "\n\n"; } echo esc_html__( 'Here’s a reminder of what you’ve ordered:', 'woocommerce' ) . "\n\n"; /** * Show the order details table, generate and output structured data. * * @hooked WC_Emails::order_details() Shows the order details table. * @hooked WC_Structured_Data::generate_order_data() Generates structured data. * @hooked WC_Structured_Data::output_structured_data() Outputs structured data. * @since 2.5.0 */ do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email ); echo "\n----------------------------------------\n\n"; /** * Show order meta data. * * @hooked WC_Emails::order_meta() Shows order meta data. * @since 1.0.0 */ do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email ); /** * Show customer details and email address. * * @hooked WC_Emails::customer_details() Shows customer details * @hooked WC_Emails::email_address() Shows email address * @since 1.0.0 */ do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email ); echo "\n\n----------------------------------------\n\n"; /** * Show user-defined additional content - this is set in each email's settings. */ if ( $additional_content ) { echo esc_html( wp_strip_all_tags( wptexturize( $additional_content ) ) ); echo "\n\n----------------------------------------\n\n"; } /** * Show store information - store details are set in the Point of Sale settings. */ if ( ! empty( $pos_store_email ) || ! empty( $pos_store_phone_number ) || ! empty( $pos_store_address ) ) { if ( ! empty( $pos_store_name ) ) { echo "\n" . esc_html( $pos_store_name ) . "\n\n"; } if ( ! empty( $pos_store_email ) ) { echo esc_html( $pos_store_email ) . "\n"; } if ( ! empty( $pos_store_phone_number ) ) { echo esc_html( $pos_store_phone_number ) . "\n"; } if ( ! empty( $pos_store_address ) ) { echo esc_html( wp_strip_all_tags( wptexturize( $pos_store_address ) ) ) . "\n"; } echo "\n----------------------------------------\n\n"; } /** * Show refund & returns policy - this is set in the Point of Sale settings. */ if ( ! empty( $pos_refund_returns_policy ) ) { echo "\n" . esc_html__( 'Refund & Returns Policy', 'woocommerce' ) . "\n\n"; echo esc_html( wp_strip_all_tags( wptexturize( $pos_refund_returns_policy ) ) ) . "\n"; echo "\n----------------------------------------\n\n"; } /** * Filter the email footer text. * * @since 4.0.0 */ echo wp_kses_post( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ), $email ) ); plain/customer-completed-order.php 0000777 00000005043 15253050367 0013323 0 ustar 00 <?php /** * Customer completed order email (plain text) * * This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/customer-completed-order.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails\Plain * @version 9.9.0 */ use Automattic\WooCommerce\Utilities\FeaturesUtil; defined( 'ABSPATH' ) || exit; $email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' ); echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n"; echo esc_html( wp_strip_all_tags( $email_heading ) ); echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n"; /* translators: %s: Customer first name */ echo sprintf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_billing_first_name() ) ) . "\n\n"; echo esc_html__( 'We have finished processing your order.', 'woocommerce' ) . "\n\n"; if ( $email_improvements_enabled ) { echo esc_html__( 'Here’s a reminder of what you’ve ordered:', 'woocommerce' ) . "\n\n"; } /* * @hooked WC_Emails::order_details() Shows the order details table. * @hooked WC_Structured_Data::generate_order_data() Generates structured data. * @hooked WC_Structured_Data::output_structured_data() Outputs structured data. * @since 2.5.0 */ do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email ); echo "\n----------------------------------------\n\n"; /* * @hooked WC_Emails::order_meta() Shows order meta data. */ do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email ); /* * @hooked WC_Emails::customer_details() Shows customer details * @hooked WC_Emails::email_address() Shows email address */ do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email ); echo "\n\n----------------------------------------\n\n"; /** * Show user-defined additional content - this is set in each email's settings. */ if ( $additional_content ) { echo esc_html( wp_strip_all_tags( wptexturize( $additional_content ) ) ); echo "\n\n----------------------------------------\n\n"; } echo wp_kses_post( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) ); plain/customer-on-hold-order.php 0000777 00000005351 15253050367 0012711 0 ustar 00 <?php /** * Customer on-hold order email * * This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/customer-on-hold-order.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails\Plain * @version 9.8.0 */ use Automattic\WooCommerce\Utilities\FeaturesUtil; defined( 'ABSPATH' ) || exit; $email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' ); echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n"; echo esc_html( wp_strip_all_tags( $email_heading ) ); echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n"; /* translators: %s: Customer first name */ echo sprintf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_billing_first_name() ) ) . "\n\n"; if ( $email_improvements_enabled ) { echo esc_html__( 'We’ve received your order and it’s currently on hold until we can confirm your payment has been processed.', 'woocommerce' ) . "\n\n"; echo esc_html__( 'Here’s a reminder of what you’ve ordered:', 'woocommerce' ) . "\n\n"; } else { echo esc_html__( 'Thanks for your order. It’s on-hold until we confirm that payment has been received.', 'woocommerce' ) . "\n\n"; } /* * @hooked WC_Emails::order_details() Shows the order details table. * @hooked WC_Structured_Data::generate_order_data() Generates structured data. * @hooked WC_Structured_Data::output_structured_data() Outputs structured data. * @since 2.5.0 */ do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email ); echo "\n----------------------------------------\n\n"; /* * @hooked WC_Emails::order_meta() Shows order meta data. */ do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email ); /* * @hooked WC_Emails::customer_details() Shows customer details * @hooked WC_Emails::email_address() Shows email address */ do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email ); echo "\n\n----------------------------------------\n\n"; /** * Show user-defined additional content - this is set in each email's settings. */ if ( $additional_content ) { echo esc_html( wp_strip_all_tags( wptexturize( $additional_content ) ) ); echo "\n\n----------------------------------------\n\n"; } echo wp_kses_post( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) ); plain/email-addresses.php 0000777 00000005152 15253050367 0011442 0 ustar 00 <?php /** * Email Addresses (plain) * * This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/email-addresses.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails\Plain * @version 8.6.0 */ defined( 'ABSPATH' ) || exit; echo "\n" . esc_html( wc_strtoupper( esc_html__( 'Billing address', 'woocommerce' ) ) ) . "\n\n"; echo preg_replace( '#<br\s*/?>#i', "\n", $order->get_formatted_billing_address() ) . "\n"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped if ( $order->get_billing_phone() ) { echo $order->get_billing_phone() . "\n"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } if ( $order->get_billing_email() ) { echo $order->get_billing_email() . "\n"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } /** * Fires after the core address fields in emails. * * @since 8.6.0 * * @param string $type Address type. Either 'billing' or 'shipping'. * @param WC_Order $order Order instance. * @param bool $sent_to_admin If this email is being sent to the admin or not. * @param bool $plain_text If this email is plain text or not. */ do_action( 'woocommerce_email_customer_address_section', 'billing', $order, $sent_to_admin, true ); if ( ! wc_ship_to_billing_address_only() && $order->needs_shipping_address() ) { $shipping = $order->get_formatted_shipping_address(); if ( $shipping ) { echo "\n" . esc_html( wc_strtoupper( esc_html__( 'Shipping address', 'woocommerce' ) ) ) . "\n\n"; echo preg_replace( '#<br\s*/?>#i', "\n", $shipping ) . "\n"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped if ( $order->get_shipping_phone() ) { echo $order->get_shipping_phone() . "\n"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } /** * Fires after the core address fields in emails. * * @since 8.6.0 * * @param string $type Address type. Either 'billing' or 'shipping'. * @param WC_Order $order Order instance. * @param bool $sent_to_admin If this email is being sent to the admin or not. * @param bool $plain_text If this email is plain text or not. */ do_action( 'woocommerce_email_customer_address_section', 'shipping', $order, $sent_to_admin, true ); } } plain/email-downloads.php 0000777 00000003252 15253050367 0011456 0 ustar 00 <?php /** * Email Downloads. * * This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/email-downloads.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates * @version 3.4.0 */ defined( 'ABSPATH' ) || exit; echo esc_html( wc_strtoupper( esc_html__( 'Downloads', 'woocommerce' ) ) ) . "\n\n"; foreach ( $downloads as $download ) { foreach ( $columns as $column_id => $column_name ) { echo wp_kses_post( $column_name ) . ': '; if ( has_action( 'woocommerce_email_downloads_column_' . $column_id ) ) { do_action( 'woocommerce_email_downloads_column_' . $column_id, $download, $plain_text ); } else { switch ( $column_id ) { case 'download-product': echo esc_html( $download['product_name'] ); break; case 'download-file': echo esc_html( $download['download_name'] ) . ' - ' . esc_url( $download['download_url'] ); break; case 'download-expires': if ( ! empty( $download['access_expires'] ) ) { echo esc_html( date_i18n( get_option( 'date_format' ), strtotime( $download['access_expires'] ) ) ); } else { esc_html_e( 'Never', 'woocommerce' ); } break; } } echo "\n"; } echo "\n"; } echo '=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-='; echo "\n\n"; customer-pos-completed-order.php 0000777 00000007601 15253050367 0013021 0 ustar 00 <?php /** * Customer POS completed order email * * This template can be overridden by copying it to yourtheme/woocommerce/emails/customer-pos-completed-order.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails * @version 10.4.0 */ use Automattic\WooCommerce\Utilities\FeaturesUtil; if ( ! defined( 'ABSPATH' ) ) { exit; } $email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' ); /** * Hook for the woocommerce_email_header. * * @hooked WC_Email_Customer_POS_*::email_header() Output the email header * @since 10.0.0 */ do_action( 'woocommerce_pos_email_header', $email_heading, $email ); ?> <div class="email-introduction"> <p> <?php if ( ! empty( $order->get_billing_first_name() ) ) { /* translators: %s: Customer first name */ printf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_billing_first_name() ) ); } else { printf( esc_html__( 'Hi there,', 'woocommerce' ) ); } ?> </p> <p><?php esc_html_e( 'Here’s a reminder of what you’ve bought:', 'woocommerce' ); ?></p> </div> <?php /** * Show order details. * * @hooked WC_Emails::order_details() Shows the order details table. * @hooked WC_Structured_Data::generate_order_data() Generates structured data. * @hooked WC_Structured_Data::output_structured_data() Outputs structured data. * @since 2.5.0 */ do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email ); /** * Show order meta data. * * @hooked WC_Emails::order_meta() Shows order meta data. * @since 1.0.0 */ do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email ); /** * Show customer details and email address. * * @hooked WC_Emails::customer_details() Shows customer details * @hooked WC_Emails::email_address() Shows email address * @since 1.0.0 */ do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email ); /** * Show user-defined additional content - this is set in each email's settings. */ if ( $additional_content ) { echo $email_improvements_enabled ? '<table border="0" cellpadding="0" cellspacing="0" width="100%" role="presentation"><tr><td class="email-additional-content">' : ''; echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) ); echo $email_improvements_enabled ? '</td></tr></table>' : ''; } /** * Show store information - store details are set in the Point of Sale settings. */ if ( ! empty( $pos_store_email ) || ! empty( $pos_store_phone_number ) || ! empty( $pos_store_address ) ) { echo '<div class="pos-store-information">'; if ( ! empty( $pos_store_name ) ) { echo '<h2>' . esc_html( $pos_store_name ) . '</h2>'; } if ( ! empty( $pos_store_email ) ) { echo '<p>' . esc_html( $pos_store_email ) . '</p>'; } if ( ! empty( $pos_store_phone_number ) ) { echo '<p>' . esc_html( $pos_store_phone_number ) . '</p>'; } if ( ! empty( $pos_store_address ) ) { echo wp_kses_post( wpautop( wptexturize( $pos_store_address ) ) ); } echo '</div>'; } /** * Show refund & returns policy - this is set in the Point of Sale settings. */ if ( ! empty( $pos_refund_returns_policy ) ) { echo '<div class="refund-returns-policy">'; echo '<h2>' . esc_html__( 'Refund & Returns Policy', 'woocommerce' ) . '</h2>'; echo wp_kses_post( wpautop( wptexturize( $pos_refund_returns_policy ) ) ); echo '</div>'; } /** * Output the email footer * * @hooked WC_Email_Customer_POS_*::email_footer() Output the email footer * @since 10.0.0 */ do_action( 'woocommerce_pos_email_footer', $email ); customer-pos-refunded-order.php 0000777 00000010421 15253050367 0012633 0 ustar 00 <?php /** * Customer POS refunded order email * * This template can be overridden by copying it to yourtheme/woocommerce/emails/customer-pos-refunded-order.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails * @version 10.4.0 */ use Automattic\WooCommerce\Utilities\FeaturesUtil; defined( 'ABSPATH' ) || exit; $email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' ); /** * Hook for the woocommerce_email_header. * * @hooked WC_Email_Customer_POS_*::email_header() Output the email header * @since 10.0.0 */ do_action( 'woocommerce_pos_email_header', $email_heading, $email ); ?> <div class="email-introduction"> <p> <?php if ( ! empty( $order->get_billing_first_name() ) ) { /* translators: %s: Customer first name */ printf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_billing_first_name() ) ); } else { printf( esc_html__( 'Hi there,', 'woocommerce' ) ); } ?> </p> <p> <?php if ( $partial_refund ) { /* translators: %s: Site title */ echo sprintf( esc_html__( 'Your order from %s has been partially refunded.', 'woocommerce' ), esc_html( $pos_store_name ) ) . "\n\n"; } else { /* translators: %s: Site title */ echo sprintf( esc_html__( 'Your order from %s has been refunded.', 'woocommerce' ), esc_html( $pos_store_name ) ) . "\n\n"; } echo '</p><p>'; echo esc_html__( 'Here’s a reminder of what you’ve bought:', 'woocommerce' ) . "\n\n"; ?> </p> </div> <?php /** * Show order details. * * @hooked WC_Emails::order_details() Shows the order details table. * @hooked WC_Structured_Data::generate_order_data() Generates structured data. * @hooked WC_Structured_Data::output_structured_data() Outputs structured data. * @since 2.5.0 */ do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email ); /** * Show order meta data. * * @hooked WC_Emails::order_meta() Shows order meta data. * @since 1.0.0 */ do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email ); /** * Show customer details and email address. * * @hooked WC_Emails::customer_details() Shows customer details * @hooked WC_Emails::email_address() Shows email address * @since 1.0.0 */ do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email ); /** * Show user-defined additional content - this is set in each email's settings. */ if ( $additional_content ) { echo $email_improvements_enabled ? '<table border="0" cellpadding="0" cellspacing="0" width="100%" role="presentation"><tr><td class="email-additional-content">' : ''; echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) ); echo $email_improvements_enabled ? '</td></tr></table>' : ''; } /** * Show store information - store details are set in the Point of Sale settings. */ if ( ! empty( $pos_store_email ) || ! empty( $pos_store_phone_number ) || ! empty( $pos_store_address ) ) { echo '<div class="pos-store-information">'; if ( ! empty( $pos_store_name ) ) { echo '<h2>' . esc_html( $pos_store_name ) . '</h2>'; } if ( ! empty( $pos_store_email ) ) { echo '<p>' . esc_html( $pos_store_email ) . '</p>'; } if ( ! empty( $pos_store_phone_number ) ) { echo '<p>' . esc_html( $pos_store_phone_number ) . '</p>'; } if ( ! empty( $pos_store_address ) ) { echo wp_kses_post( wpautop( wptexturize( $pos_store_address ) ) ); } echo '</div>'; } /** * Show refund & returns policy - this is set in the Point of Sale settings. */ if ( ! empty( $pos_refund_returns_policy ) ) { echo '<div class="refund-returns-policy">'; echo '<h2>' . esc_html__( 'Refund & Returns Policy', 'woocommerce' ) . '</h2>'; echo wp_kses_post( wpautop( wptexturize( $pos_refund_returns_policy ) ) ); echo '</div>'; } /** * Hook for the woocommerce_email_footer. * * @hooked WC_Email_Customer_POS_*::email_footer() Output the email footer * @since 10.0.0 */ do_action( 'woocommerce_pos_email_footer', $email ); admin-new-order.php 0000777 00000005304 15253050367 0010264 0 ustar 00 <?php /** * Admin new order email * * This template can be overridden by copying it to yourtheme/woocommerce/emails/admin-new-order.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails\HTML * @version 10.4.0 */ use Automattic\WooCommerce\Utilities\FeaturesUtil; defined( 'ABSPATH' ) || exit; $email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' ); /* * @hooked WC_Emails::email_header() Output the email header */ do_action( 'woocommerce_email_header', $email_heading, $email ); ?> <?php echo $email_improvements_enabled ? '<div class="email-introduction">' : ''; /* translators: %s: Customer billing full name */ $text = __( 'You’ve received the following order from %s:', 'woocommerce' ); if ( $email_improvements_enabled ) { /* translators: %s: Customer billing full name */ $text = __( 'You’ve received a new order from %s:', 'woocommerce' ); } ?> <p><?php printf( esc_html( $text ), esc_html( $order->get_formatted_billing_full_name() ) ); ?></p> <?php echo $email_improvements_enabled ? '</div>' : ''; ?> <?php /* * @hooked WC_Emails::order_details() Shows the order details table. * @hooked WC_Structured_Data::generate_order_data() Generates structured data. * @hooked WC_Structured_Data::output_structured_data() Outputs structured data. * @since 2.5.0 */ do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email ); /* * @hooked WC_Emails::order_meta() Shows order meta data. */ do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email ); /* * @hooked WC_Emails::customer_details() Shows customer details * @hooked WC_Emails::email_address() Shows email address */ do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email ); /** * Show user-defined additional content - this is set in each email's settings. */ if ( $additional_content ) { echo $email_improvements_enabled ? '<table border="0" cellpadding="0" cellspacing="0" width="100%" role="presentation"><tr><td class="email-additional-content">' : ''; echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) ); echo $email_improvements_enabled ? '</td></tr></table>' : ''; } /* * @hooked WC_Emails::email_footer() Output the email footer */ do_action( 'woocommerce_email_footer', $email ); customer-reset-password.php 0000777 00000006247 15253050367 0012124 0 ustar 00 <?php /** * Customer Reset Password email * * This template can be overridden by copying it to yourtheme/woocommerce/emails/customer-reset-password.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails * @version 10.4.0 */ use Automattic\WooCommerce\Utilities\FeaturesUtil; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } $email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' ); ?> <?php do_action( 'woocommerce_email_header', $email_heading, $email ); ?> <?php echo $email_improvements_enabled ? '<div class="email-introduction">' : ''; ?> <?php /* translators: %s: Customer username */ ?> <p><?php printf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $user_login ) ); ?></p> <?php /* translators: %s: Store name */ ?> <p><?php printf( esc_html__( 'Someone has requested a new password for the following account on %s:', 'woocommerce' ), esc_html( $blogname ) ); ?></p> <?php if ( $email_improvements_enabled ) : ?> <div class="hr hr-top"></div> <?php /* translators: %s: Username */ ?> <p><?php echo wp_kses( sprintf( __( 'Username: <b>%s</b>', 'woocommerce' ), esc_html( $user_login ) ), array( 'b' => array() ) ); ?></p> <div class="hr hr-bottom"></div> <p><?php esc_html_e( 'If you didn’t make this request, just ignore this email. If you’d like to proceed, reset your password via the link below:', 'woocommerce' ); ?></p> <?php else : ?> <?php /* translators: %s: Customer username */ ?> <p><?php printf( esc_html__( 'Username: %s', 'woocommerce' ), esc_html( $user_login ) ); ?></p> <p><?php esc_html_e( 'If you didn\'t make this request, just ignore this email. If you\'d like to proceed:', 'woocommerce' ); ?></p> <?php endif; ?> <p> <a class="link" href="<?php echo esc_url( add_query_arg( array( 'key' => $reset_key, 'id' => $user_id, 'login' => rawurlencode( $user_login ) ), wc_get_endpoint_url( 'lost-password', '', wc_get_page_permalink( 'myaccount' ) ) ) ); ?>"><?php // phpcs:ignore WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound ?> <?php if ( $email_improvements_enabled ) { esc_html_e( 'Reset your password', 'woocommerce' ); } else { esc_html_e( 'Click here to reset your password', 'woocommerce' ); } ?> </a> </p> <?php echo $email_improvements_enabled ? '</div>' : ''; ?> <?php /** * Show user-defined additional content - this is set in each email's settings. */ if ( $additional_content ) { echo $email_improvements_enabled ? '<table border="0" cellpadding="0" cellspacing="0" width="100%" role="presentation"><tr><td class="email-additional-content email-additional-content-aligned">' : ''; echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) ); echo $email_improvements_enabled ? '</td></tr></table>' : ''; } do_action( 'woocommerce_email_footer', $email ); admin-cancelled-order.php 0000777 00000005534 15253050367 0011412 0 ustar 00 <?php /** * Admin cancelled order email * * This template can be overridden by copying it to yourtheme/woocommerce/emails/admin-cancelled-order.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails * @version 9.8.0 */ use Automattic\WooCommerce\Utilities\FeaturesUtil; if ( ! defined( 'ABSPATH' ) ) { exit; } $email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' ); /* * @hooked WC_Emails::email_header() Output the email header */ do_action( 'woocommerce_email_header', $email_heading, $email ); ?> <?php echo $email_improvements_enabled ? '<div class="email-introduction">' : ''; /* translators: %1$s: Order number. %2$s: Customer full name */ $text = __( 'Notification to let you know — order #%1$s belonging to %2$s has been cancelled:', 'woocommerce' ); if ( $email_improvements_enabled ) { /* translators: %1$s: Order number. %2$s: Customer full name */ $text = __( 'We’re getting in touch to let you know that order #%1$s from %2$s has been cancelled.', 'woocommerce' ); } ?> <p><?php printf( esc_html( $text ), esc_html( $order->get_order_number() ), esc_html( $order->get_formatted_billing_full_name() ) ); ?></p> <?php echo $email_improvements_enabled ? '</div>' : ''; ?> <?php /* * @hooked WC_Emails::order_details() Shows the order details table. * @hooked WC_Structured_Data::generate_order_data() Generates structured data. * @hooked WC_Structured_Data::output_structured_data() Outputs structured data. * @since 2.5.0 */ do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email ); /* * @hooked WC_Emails::order_meta() Shows order meta data. */ do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email ); /* * @hooked WC_Emails::customer_details() Shows customer details * @hooked WC_Emails::email_address() Shows email address */ do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email ); /** * Show user-defined additional content - this is set in each email's settings. */ if ( $additional_content ) { echo $email_improvements_enabled ? '<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td class="email-additional-content">' : ''; echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) ); echo $email_improvements_enabled ? '</td></tr></table>' : ''; } /* * @hooked WC_Emails::email_footer() Output the email footer */ do_action( 'woocommerce_email_footer', $email ); admin-failed-order.php 0000777 00000005541 15253050367 0010722 0 ustar 00 <?php /** * Admin failed order email * * This template can be overridden by copying it to yourtheme/woocommerce/emails/admin-failed-order.php * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails * @version 10.4.0 */ use Automattic\WooCommerce\Utilities\FeaturesUtil; if ( ! defined( 'ABSPATH' ) ) { exit; } $email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' ); /* * @hooked WC_Emails::email_header() Output the email header */ do_action( 'woocommerce_email_header', $email_heading, $email ); ?> <?php echo $email_improvements_enabled ? '<div class="email-introduction">' : ''; /* translators: %1$s: Order number. %2$s: Customer full name. */ $text = __( 'Payment for order #%1$s from %2$s has failed. The order was as follows:', 'woocommerce' ); if ( $email_improvements_enabled ) { /* translators: %1$s: Order number. %2$s: Customer full name. */ $text = __( 'Unfortunately, the payment for order #%1$s from %2$s has failed. The order was as follows:', 'woocommerce' ); } ?> <p><?php printf( esc_html( $text ), esc_html( $order->get_order_number() ), esc_html( $order->get_formatted_billing_full_name() ) ); ?></p> <?php echo $email_improvements_enabled ? '</div>' : ''; ?> <?php /* * @hooked WC_Emails::order_details() Shows the order details table. * @hooked WC_Structured_Data::generate_order_data() Generates structured data. * @hooked WC_Structured_Data::output_structured_data() Outputs structured data. * @since 2.5.0 */ do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email ); /* * @hooked WC_Emails::order_meta() Shows order meta data. */ do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email ); /* * @hooked WC_Emails::customer_details() Shows customer details * @hooked WC_Emails::email_address() Shows email address */ do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email ); /** * Show user-defined additional content - this is set in each email's settings. */ if ( $additional_content ) { echo $email_improvements_enabled ? '<table border="0" cellpadding="0" cellspacing="0" width="100%" role="presentation"><tr><td class="email-additional-content">' : ''; echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) ); echo $email_improvements_enabled ? '</td></tr></table>' : ''; } /* * @hooked WC_Emails::email_footer() Output the email footer */ do_action( 'woocommerce_email_footer', $email ); customer-note.php 0000777 00000005734 15253050367 0010107 0 ustar 00 <?php /** * Customer note email * * This template can be overridden by copying it to yourtheme/woocommerce/emails/customer-note.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails * @version 10.4.0 */ use Automattic\WooCommerce\Utilities\FeaturesUtil; if ( ! defined( 'ABSPATH' ) ) { exit; } $email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' ); /* * @hooked WC_Emails::email_header() Output the email header */ do_action( 'woocommerce_email_header', $email_heading, $email ); ?> <?php echo $email_improvements_enabled ? '<div class="email-introduction">' : ''; ?> <p> <?php if ( ! empty( $order->get_billing_first_name() ) ) { /* translators: %s: Customer first name */ printf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_billing_first_name() ) ); } else { printf( esc_html__( 'Hi,', 'woocommerce' ) ); } ?> </p> <p><?php esc_html_e( 'The following note has been added to your order:', 'woocommerce' ); ?></p> <blockquote> <?php $safe_note = wc_wptexturize_order_note( $customer_note ); echo wpautop( make_clickable( $safe_note ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> </blockquote> <p><?php esc_html_e( 'As a reminder, here are your order details:', 'woocommerce' ); ?></p> <?php echo $email_improvements_enabled ? '</div>' : ''; ?> <?php /* * @hooked WC_Emails::order_details() Shows the order details table. * @hooked WC_Structured_Data::generate_order_data() Generates structured data. * @hooked WC_Structured_Data::output_structured_data() Outputs structured data. * @since 2.5.0 */ do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email ); /* * @hooked WC_Emails::order_meta() Shows order meta data. */ do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email ); /* * @hooked WC_Emails::customer_details() Shows customer details * @hooked WC_Emails::email_address() Shows email address */ do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email ); /** * Show user-defined additional content - this is set in each email's settings. */ if ( $additional_content ) { echo $email_improvements_enabled ? '<table border="0" cellpadding="0" cellspacing="0" width="100%" role="presentation"><tr><td class="email-additional-content">' : ''; echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) ); echo $email_improvements_enabled ? '</td></tr></table>' : ''; } /* * @hooked WC_Emails::email_footer() Output the email footer */ do_action( 'woocommerce_email_footer', $email ); email-footer.php 0000777 00000005410 15253050367 0007655 0 ustar 00 <?php /** * Email Footer * * This template can be overridden by copying it to yourtheme/woocommerce/emails/email-footer.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails * @version 10.4.0 */ defined( 'ABSPATH' ) || exit; $email = $email ?? null; ?> </div> </td> </tr> </table> <!-- End Content --> </td> </tr> </table> <!-- End Body --> </td> </tr> </table> </td> </tr> <tr> <td align="center" valign="top"> <!-- Footer --> <table border="0" cellpadding="10" cellspacing="0" width="100%" id="template_footer" role="presentation"> <tr> <td valign="top"> <table border="0" cellpadding="10" cellspacing="0" width="100%" role="presentation"> <tr> <td colspan="2" valign="middle" id="credit"> <?php $email_footer_text = get_option( 'woocommerce_email_footer_text' ); /** * This filter is documented in templates/emails/email-styles.php * * @since 9.6.0 */ if ( apply_filters( 'woocommerce_is_email_preview', false ) ) { $text_transient = get_transient( 'woocommerce_email_footer_text' ); $email_footer_text = false !== $text_transient ? $text_transient : $email_footer_text; } echo wp_kses_post( wpautop( wptexturize( /** * Provides control over the email footer text used for most order emails. * * @since 4.0.0 * * @param string $email_footer_text */ apply_filters( 'woocommerce_email_footer_text', $email_footer_text, $email ) ) ) ); ?> </td> </tr> </table> </td> </tr> </table> <!-- End Footer --> </td> </tr> </table> </div> </td> <td><!-- Deliberately empty to support consistent sizing and layout across multiple email clients. --></td> </tr> </table> </body> </html> customer-cancelled-order.php 0000777 00000006021 15253050367 0012153 0 ustar 00 <?php /** * Customer cancelled order email * * This template can be overridden by copying it to yourtheme/woocommerce/emails/customer-cancelled-order.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails * @version 10.4.0 */ use Automattic\WooCommerce\Utilities\FeaturesUtil; if ( ! defined( 'ABSPATH' ) ) { exit; } $email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' ); /** * Hook: woocommerce_email_header. * * @hooked WC_Emails::email_header() Output the email header * @since 2.5.0 */ do_action( 'woocommerce_email_header', $email_heading, $email ); ?> <?php echo $email_improvements_enabled ? '<div class="email-introduction">' : ''; /* translators: %1$s: Order number */ $text = __( 'We’re sorry to let you know that your order #%1$s has been cancelled.', 'woocommerce' ); if ( $email_improvements_enabled ) { /* translators: %1$s: Order number */ $text = __( 'We’re getting in touch to let you know that your order #%1$s has been cancelled.', 'woocommerce' ); } ?> <p><?php printf( esc_html( $text ), esc_html( $order->get_order_number() ) ); ?></p> <?php echo $email_improvements_enabled ? '</div>' : ''; ?> <?php /** * Hook: woocommerce_email_order_details. * * @hooked WC_Emails::order_details() Shows the order details table. * @hooked WC_Structured_Data::generate_order_data() Generates structured data. * @hooked WC_Structured_Data::output_structured_data() Outputs structured data. * @since 2.5.0 */ do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email ); /** * Hook: woocommerce_email_order_meta. * * @hooked WC_Emails::order_meta() Shows order meta data. * @since 2.5.0 */ do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email ); /** * Hook: woocommerce_email_customer_details. * * @hooked WC_Emails::customer_details() Shows customer details * @hooked WC_Emails::email_address() Shows email address * @since 2.5.0 */ do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email ); /** * Show user-defined additional content - this is set in each email's settings. */ if ( $additional_content ) { echo $email_improvements_enabled ? '<table border="0" cellpadding="0" cellspacing="0" width="100%" role="presentation"><tr><td class="email-additional-content">' : ''; echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) ); echo $email_improvements_enabled ? '</td></tr></table>' : ''; } /** * Hook: woocommerce_email_footer. * * @hooked WC_Emails::email_footer() Output the email footer * @since 2.5.0 */ do_action( 'woocommerce_email_footer', $email );
| ver. 1.6 |
Github
|
.
| PHP 8.1.34 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка