Advertisement
geminilabs

review-reminder-plain.php

Dec 4th, 2023 (edited)
990
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.77 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Customer follow-up email sent after purchase with a reminder to write a review (plain text)
  4.  *
  5.  * This template can be overridden by copying it to yourtheme/site-reviews-notifications/woocommerce/review-reminder-plain.php.
  6.  *
  7.  * HOWEVER, on occasion the Site Reviews Notifications add-on will need to update
  8.  * template files and you (the theme developer) will need to copy the new files
  9.  * to your theme to maintain compatibility. We try to do this as little as
  10.  * possible, but it does happen. When this occurs the version of the template
  11.  * file will be bumped and the readme will list any important changes.
  12.  *
  13.  * @version 1.0.0
  14.  */
  15.  
  16. defined('ABSPATH') || exit;
  17.  
  18. echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n";
  19. echo esc_html(wp_strip_all_tags($email_heading));
  20. echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
  21.  
  22. /**
  23.  * Show user-defined content - this is set in the email's settings.
  24.  */
  25. echo esc_html(wp_strip_all_tags(wptexturize($content)));
  26. echo "\n\n----------------------------------------\n\n";
  27.  
  28. echo sprintf(esc_html_x('Here are the details of your order placed on %s:', 'Order date', 'site-reviews-woocommerce'), esc_html(wc_format_datetime($order->get_date_created())))."\n\n";
  29.  
  30. echo wp_kses_post(wc_strtoupper(sprintf(esc_html_x('[Order #%s]', 'Order ID', 'site-reviews-notifications').' (%s)', $order->get_order_number(), wc_format_datetime($order->get_date_created()))));
  31.  
  32. foreach ($items as $item_id => $item) {
  33.     if (!apply_filters('woocommerce_order_item_visible', true, $item)) {
  34.         continue;
  35.     }
  36.     $product = $item->get_product();
  37.  
  38.     // phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
  39.     echo "\n\n".wp_kses_post(apply_filters('woocommerce_order_item_name', $item->get_name(), $item, false));
  40.  
  41.     $language = get_post_meta($order->get_id(), 'wpml_language', true);
  42.     $permalink = apply_filters('wpml_permalink', $product->get_permalink(), $language);
  43.  
  44.     echo "\n".$permalink.'#reviews';
  45.  
  46.     // allow other plugins to add additional product information here.
  47.     do_action('woocommerce_order_item_meta_start', $item_id, $item, $order, $plain_text);
  48.  
  49.     // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
  50.     echo strip_tags(
  51.         wc_display_item_meta($item, [
  52.             'before' => "\n- ",
  53.             'separator' => "\n- ",
  54.             'after' => '',
  55.             'echo' => false,
  56.             'autop' => false,
  57.         ])
  58.     );
  59.  
  60.     // allow other plugins to add additional product information here.
  61.     do_action('woocommerce_order_item_meta_end', $item_id, $item, $order, $plain_text);
  62. }
  63.  
  64. echo "\n\n----------------------------------------\n\n";
  65.  
  66. echo wp_kses_post(apply_filters('woocommerce_email_footer_text', get_option('woocommerce_email_footer_text')));
  67.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement