Kadence WooCommerce Email Designer - Version 1.4.3

Version Description

  • Update: Tweak address css.
  • Update: Show WC 4.3.0 support.
  • Add: {site_address} placeholder.
  • Add: Image size option for product images.
Download this release

Release Info

Developer britner
Plugin Icon 128x128 Kadence WooCommerce Email Designer
Version 1.4.3
Comparing to
See all releases

Code changes from version 1.4.2 to 1.4.3

includes/class-kadence-woomail-preview.php CHANGED
@@ -876,6 +876,7 @@ if ( ! class_exists( 'Kadence_Woomail_Preview' ) ) {
876
 
877
  // Get information from email to use in placeholders.
878
  $scripts .= 'var pl_site_title = "' . get_bloginfo( 'name', 'display' ) . '";';
 
879
  $scripts .= 'var pl_year = "' . date( 'Y' ) . '";';
880
  if ( is_object( self::$current_order ) ) {
881
  $scripts .= 'var pl_order_date = "' . wc_format_datetime( self::$current_order->get_date_created() ) . '";';
@@ -910,6 +911,8 @@ if ( ! class_exists( 'Kadence_Woomail_Preview' ) ) {
910
  if (value && value.includes('{year}') ) {
911
  value = value.replace('{year}', pl_year);
912
  }
 
 
913
  } else if (value && value.includes('{order_date}') ) {
914
  value = value.replace('{order_date}', pl_order_date);
915
  } else if (value && value.includes('{order_number}') ) {
876
 
877
  // Get information from email to use in placeholders.
878
  $scripts .= 'var pl_site_title = "' . get_bloginfo( 'name', 'display' ) . '";';
879
+ $scripts .= 'var pl_site_address = "' . wp_parse_url( home_url(), PHP_URL_HOST ) . '";';
880
  $scripts .= 'var pl_year = "' . date( 'Y' ) . '";';
881
  if ( is_object( self::$current_order ) ) {
882
  $scripts .= 'var pl_order_date = "' . wc_format_datetime( self::$current_order->get_date_created() ) . '";';
911
  if (value && value.includes('{year}') ) {
912
  value = value.replace('{year}', pl_year);
913
  }
914
+ } else if (value && value.includes('{site_address}') ) {
915
+ value = value.replace('{site_address}', pl_site_address);
916
  } else if (value && value.includes('{order_date}') ) {
917
  value = value.replace('{order_date}', pl_order_date);
918
  } else if (value && value.includes('{order_number}') ) {
includes/class-kadence-woomail-settings.php CHANGED
@@ -2084,6 +2084,22 @@ if ( ! class_exists( 'Kadence_Woomail_Settings' ) ) {
2084
  'show' => __( 'Show', 'kadence-woocommerce-email-designer' ),
2085
  ),
2086
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2087
  // Items table Background color.
2088
  'items_table_background_color' => array(
2089
  'title' => __( 'Order Table Background color', 'kadence-woocommerce-email-designer' ),
@@ -3027,6 +3043,7 @@ To reset your password, visit the following address:',
3027
  'btn_size' => '16',
3028
  'order_items_style' => 'normal',
3029
  'order_items_image' => 'normal',
 
3030
  'items_table_border_width' => '1',
3031
  'items_table_border_color' => '#e4e4e4',
3032
  'items_table_border_style' => 'solid',
2084
  'show' => __( 'Show', 'kadence-woocommerce-email-designer' ),
2085
  ),
2086
  ),
2087
+ // Order ITEMS Image size.
2088
+ 'order_items_image_size' => array(
2089
+ 'title' => __( 'Product Image Size', 'kadence-woocommerce-email-designer' ),
2090
+ 'section' => 'items_table',
2091
+ 'default' => self::get_default_value( 'order_items_image_size' ),
2092
+ 'transport' => 'refresh',
2093
+ 'type' => 'select',
2094
+ 'choices' => array(
2095
+ '40x40' => __( '40x40', 'kadence-woocommerce-email-designer' ),
2096
+ '50x50' => __( '50x50', 'kadence-woocommerce-email-designer' ),
2097
+ '100x50' => __( '100x50', 'kadence-woocommerce-email-designer' ),
2098
+ '100x100' => __( '100x100', 'kadence-woocommerce-email-designer' ),
2099
+ '150x150' => __( '150x150', 'kadence-woocommerce-email-designer' ),
2100
+ 'woocommerce_thumbnail' => __( 'Woocommerce Thumbnail', 'kadence-woocommerce-email-designer' ),
2101
+ ),
2102
+ ),
2103
  // Items table Background color.
2104
  'items_table_background_color' => array(
2105
  'title' => __( 'Order Table Background color', 'kadence-woocommerce-email-designer' ),
3043
  'btn_size' => '16',
3044
  'order_items_style' => 'normal',
3045
  'order_items_image' => 'normal',
3046
+ 'order_items_image_size' => '100x50',
3047
  'items_table_border_width' => '1',
3048
  'items_table_border_color' => '#e4e4e4',
3049
  'items_table_border_style' => 'solid',
kadence-woocommerce-email-designer.php CHANGED
@@ -3,13 +3,13 @@
3
  * Plugin Name: Kadence WooCommerce Email Designer
4
  * Plugin URI: http://kadencewp.com/products/woocommerce-email-designer/
5
  * Description: Customize the default woocommerce email templates design and text through the native WordPress customizer. Preview emails and send test emails.
6
- * Version: 1.4.2
7
  * Author: Kadence WP
8
  * Author URI: http://kadencewp.com/
9
  * License: GPLv2 or later
10
  * Text Domain: kadence-woocommerce-email-designer
11
  * WC requires at least: 3.6.0
12
- * WC tested up to: 4.2.2
13
  *
14
  * @package Kadence Woocommerce Email Designer
15
  */
@@ -180,9 +180,18 @@ class Kadence_Woomail_Designer {
180
  */
181
  public function add_wc_order_email_args_images( $args ) {
182
  $product_photo = Kadence_Woomail_Customizer::opt( 'order_items_image' );
 
183
  if ( 'show' === $product_photo ) {
184
  $args['show_image'] = true;
185
- $args['image_size'] = array( 100, 50 );
 
 
 
 
 
 
 
 
186
  }
187
  return $args;
188
  }
@@ -356,6 +365,9 @@ class Kadence_Woomail_Designer {
356
  $body_text = Kadence_Woomail_Customizer::opt( $key . '_body' );
357
  }
358
  $body_text = str_replace( '{site_title}', get_bloginfo( 'name', 'display' ), $body_text );
 
 
 
359
  if ( $order ) {
360
  if ( 0 === ( $user_id = (int) get_post_meta( $order->get_id(), '_customer_user', true ) ) ) {
361
  $user_id = 'guest';
@@ -409,6 +421,8 @@ class Kadence_Woomail_Designer {
409
  public static function filter_subtitle( $subtitle, $email ) {
410
  // Check for placeholders.
411
  $subtitle = str_replace( '{site_title}', get_bloginfo( 'name', 'display' ), $subtitle );
 
 
412
  if ( is_a( $email->object, 'WP_User' ) ) {
413
  $first_name = get_user_meta( $email->object->ID, 'billing_first_name', true );
414
  if ( empty( $first_name ) ) {
@@ -468,6 +482,8 @@ class Kadence_Woomail_Designer {
468
  $body_text = Kadence_Woomail_Customizer::opt( $key . '_body' );
469
  // Check for placeholders.
470
  $body_text = str_replace( '{site_title}', get_bloginfo( 'name', 'display' ), $body_text );
 
 
471
  if ( is_a( $email->object, 'WP_User' ) ) {
472
 
473
  $first_name = get_user_meta( $email->object->ID, 'billing_first_name', true );
3
  * Plugin Name: Kadence WooCommerce Email Designer
4
  * Plugin URI: http://kadencewp.com/products/woocommerce-email-designer/
5
  * Description: Customize the default woocommerce email templates design and text through the native WordPress customizer. Preview emails and send test emails.
6
+ * Version: 1.4.3
7
  * Author: Kadence WP
8
  * Author URI: http://kadencewp.com/
9
  * License: GPLv2 or later
10
  * Text Domain: kadence-woocommerce-email-designer
11
  * WC requires at least: 3.6.0
12
+ * WC tested up to: 4.3.0
13
  *
14
  * @package Kadence Woocommerce Email Designer
15
  */
180
  */
181
  public function add_wc_order_email_args_images( $args ) {
182
  $product_photo = Kadence_Woomail_Customizer::opt( 'order_items_image' );
183
+ $size = Kadence_Woomail_Customizer::opt( 'order_items_image_size' );
184
  if ( 'show' === $product_photo ) {
185
  $args['show_image'] = true;
186
+ if ( '100x100' === $size ) {
187
+ $args['image_size'] = array( 100, 100 );
188
+ } else if ( '150x150' === $size ) {
189
+ $args['image_size'] = array( 150, 150 );
190
+ } else if ( 'woocommerce_thumbnail' === $size ) {
191
+ $args['image_size'] = 'woocommerce_thumbnail';
192
+ } else {
193
+ $args['image_size'] = array( 100, 50 );
194
+ }
195
  }
196
  return $args;
197
  }
365
  $body_text = Kadence_Woomail_Customizer::opt( $key . '_body' );
366
  }
367
  $body_text = str_replace( '{site_title}', get_bloginfo( 'name', 'display' ), $body_text );
368
+ $body_text = str_replace( '{site_address}', wp_parse_url( home_url(), PHP_URL_HOST ), $body_text );
369
+ $body_text = str_replace( '{site_url}', wp_parse_url( home_url(), PHP_URL_HOST ), $body_text );
370
+
371
  if ( $order ) {
372
  if ( 0 === ( $user_id = (int) get_post_meta( $order->get_id(), '_customer_user', true ) ) ) {
373
  $user_id = 'guest';
421
  public static function filter_subtitle( $subtitle, $email ) {
422
  // Check for placeholders.
423
  $subtitle = str_replace( '{site_title}', get_bloginfo( 'name', 'display' ), $subtitle );
424
+ $subtitle = str_replace( '{site_address}', wp_parse_url( home_url(), PHP_URL_HOST ), $subtitle );
425
+ $subtitle = str_replace( '{site_url}', wp_parse_url( home_url(), PHP_URL_HOST ), $subtitle );
426
  if ( is_a( $email->object, 'WP_User' ) ) {
427
  $first_name = get_user_meta( $email->object->ID, 'billing_first_name', true );
428
  if ( empty( $first_name ) ) {
482
  $body_text = Kadence_Woomail_Customizer::opt( $key . '_body' );
483
  // Check for placeholders.
484
  $body_text = str_replace( '{site_title}', get_bloginfo( 'name', 'display' ), $body_text );
485
+ $body_text = str_replace( '{site_address}', wp_parse_url( home_url(), PHP_URL_HOST ), $body_text );
486
+ $body_text = str_replace( '{site_url}', wp_parse_url( home_url(), PHP_URL_HOST ), $body_text );
487
  if ( is_a( $email->object, 'WP_User' ) ) {
488
 
489
  $first_name = get_user_meta( $email->object->ID, 'billing_first_name', true );
readme.txt CHANGED
@@ -5,7 +5,7 @@ Donate link: https://www.kadencewp.com/about-us/
5
  Requires PHP: 5.2.4
6
  Requires at least: 4.4
7
  Tested up to: 5.4.2
8
- Stable tag: 1.4.2
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -49,6 +49,27 @@ Thanks to soderlind, we adapted our toggle control functionality from [WordPress
49
 
50
  Install the plugin into the `/wp-content/plugins/` folder, and activate it.
51
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  == Screenshots ==
53
 
54
  1. Overview of available options
@@ -60,6 +81,12 @@ Install the plugin into the `/wp-content/plugins/` folder, and activate it.
60
 
61
  == Changelog ==
62
 
 
 
 
 
 
 
63
  = 1.4.2 =
64
  * Update: Tweak some email styling for better consistency.
65
  * Update: Prevent an error when previewing invoice emails with Germanized
5
  Requires PHP: 5.2.4
6
  Requires at least: 4.4
7
  Tested up to: 5.4.2
8
+ Stable tag: 1.4.3
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
49
 
50
  Install the plugin into the `/wp-content/plugins/` folder, and activate it.
51
 
52
+ == Frequently Asked Questions ==
53
+
54
+ = What emails can I customize? =
55
+
56
+ The Kadence WooCommerce Email Designer plugin allows you to customize the style and text of all core WooCommerce emails. This plugin hooks into the main woocommerce email function to style emails and setup templates to allow you to customize the design and text. Some WooCommerce extensions add new emails to woocommerce core. Generally these emails will adapt the style (header, footer, colors, etc) you set up with the plugin but they will not be available to preview and there text will not be editable through our plugin.
57
+
58
+ We have added support for some WooCommerce extensions like WooCommerce Subscriptions, Germanized for WooCommerce, Woocommerce Memberships and WooCommerce Stripe Payment Gateway.
59
+
60
+ If you are a plugin author and wish to collaborate to add support for your plugin please [contact us](https://www.kadencewp.com/contact-us/).
61
+
62
+
63
+ = My body text is not changing, what can I do? =
64
+
65
+ In your admin navigate to WooCommerce > Status and scroll down to template overrides. If you are override email templates then that is your issue and you need to remove those overrides if you want the Kadence WooCommerce Email Designer plugin to control the templates.
66
+
67
+ = My emails are not translated? =
68
+
69
+ WooCommerce core has a large group of translators that generously translate the plugin into many languages. The Kadence WooCommerce Email Designer plugin does not have translations for many of these languages so you will need to translate some strings yourself. The easiest way to do this is through the [Loco Translate](https://wordpress.org/plugins/loco-translate/) plugin. You can install this plugin and translate parts of the emails like Price, Product, Quantity, etc into your language.
70
+
71
+ After you create your translations make sure to clear your server cache from any caching plugins. Also go to woocommerce > status > tools and clear your template cache.
72
+
73
  == Screenshots ==
74
 
75
  1. Overview of available options
81
 
82
  == Changelog ==
83
 
84
+ = 1.4.3 =
85
+ * Update: Tweak address css.
86
+ * Update: Show WC 4.3.0 support.
87
+ * Add: {site_address} placeholder.
88
+ * Add: Image size option for product images.
89
+
90
  = 1.4.2 =
91
  * Update: Tweak some email styling for better consistency.
92
  * Update: Prevent an error when previewing invoice emails with Germanized
templates/woo/emails/email-addresses.php CHANGED
@@ -64,7 +64,7 @@ if ( true == $responsive_check ) {
64
  </tr>
65
  <?php if ( ! wc_ship_to_billing_address_only() && $order->needs_shipping_address() && $shipping ) : ?>
66
  <tr>
67
- <td style="text-align:<?php echo esc_attr( $text_align ); ?>;" valign="top">
68
  <h2><?php esc_html_e( 'Shipping address', 'kadence-woocommerce-email-designer' ); ?></h2>
69
 
70
  <address class="address">
@@ -85,7 +85,7 @@ if ( true == $responsive_check ) {
85
  ?>
86
  <table id="addresses" cellspacing="0" cellpadding="0" style="width: 100%; vertical-align: top; margin-bottom: 40px; padding:0;" border="0">
87
  <tr>
88
- <td class="address-container" style="text-align:<?php echo esc_attr( $text_align ); ?>; padding:0;border:0;" valign="top" width="50%">
89
  <h2><?php esc_html_e( 'Billing address', 'kadence-woocommerce-email-designer' ); ?></h2>
90
 
91
  <address class="address">
@@ -112,7 +112,7 @@ if ( true == $responsive_check ) {
112
  </address>
113
  </td>
114
  <?php if ( ! wc_ship_to_billing_address_only() && $order->needs_shipping_address() && $shipping ) : ?>
115
- <td style="text-align:<?php echo esc_attr( $text_align ); ?>;" valign="top" width="50%">
116
  <h2><?php esc_html_e( 'Shipping address', 'kadence-woocommerce-email-designer' ); ?></h2>
117
  <address class="address">
118
  <table cellspacing="0" cellpadding="0" style="width: 100%; padding:0;" border="0">
64
  </tr>
65
  <?php if ( ! wc_ship_to_billing_address_only() && $order->needs_shipping_address() && $shipping ) : ?>
66
  <tr>
67
+ <td class="shipping-address-container" style="text-align:<?php echo esc_attr( $text_align ); ?>;" valign="top">
68
  <h2><?php esc_html_e( 'Shipping address', 'kadence-woocommerce-email-designer' ); ?></h2>
69
 
70
  <address class="address">
85
  ?>
86
  <table id="addresses" cellspacing="0" cellpadding="0" style="width: 100%; vertical-align: top; margin-bottom: 40px; padding:0;" border="0">
87
  <tr>
88
+ <td class="address-container" style="text-align:<?php echo esc_attr( $text_align ); ?>; padding:0; border:0;" valign="top" width="50%">
89
  <h2><?php esc_html_e( 'Billing address', 'kadence-woocommerce-email-designer' ); ?></h2>
90
 
91
  <address class="address">
112
  </address>
113
  </td>
114
  <?php if ( ! wc_ship_to_billing_address_only() && $order->needs_shipping_address() && $shipping ) : ?>
115
+ <td class="shipping-address-container" style="text-align:<?php echo esc_attr( $text_align ); ?>; padding:0 0 0 20px;" valign="top" width="50%">
116
  <h2><?php esc_html_e( 'Shipping address', 'kadence-woocommerce-email-designer' ); ?></h2>
117
  <address class="address">
118
  <table cellspacing="0" cellpadding="0" style="width: 100%; padding:0;" border="0">