diff --git a/README.txt b/README.txt index ca54b89..8116da4 100755 --- a/README.txt +++ b/README.txt @@ -1,9 +1,9 @@ -=== Email Templates === +=== Email Templates Customizer and Designer for WordPress and WooCommerce === Contributors: wpexpertsio -Tags: email templates, email template, html email, email template, template, better emails, wp better emails, wp email templates, html emails, postman, wp smtp, woocommerce, easy digital downloads -Requires at least: 4.0 -Tested up to: 5.9 -Stable tag: 1.3.2.1 +Tags: Email templates, email designer, email customizer, email, woocommerce email +Requires at least: 7.4 +Tested up to: 6.1.1 +Stable tag: 1.4 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -37,7 +37,8 @@ Send your translations to [Transifex](https://www.transifex.com/projects/p/wp-em 1. Upload the plugin in /wp-admin/plugin-install.php 2. Activate the plugin through the 'Plugins' menu in WordPress -3. Click on Appearance -> "Email Templates" to start editing +3. Click on Email Templates -> "WordPress Email" to start editing +4. Click on Email Templates -> "WooCommerce Email" to start editing == Frequently Asked Questions == @@ -54,9 +55,20 @@ Copy the templates folder into your theme , then in functions.php add the follow 1. Email Templates - Settings 2. Boxed layout 3. Full-width layout +4. Email Notification +5. Email Type +6. Background Color +7. Bundle Icon +8. Send Preview Email +9. Email Type and Text +10. Font Family +11. WooCommerce Emails == Changelog == += 1.4 = +* NEW - WooCommerce Email Customizer Added + = 1.3.2.1 = * Emails not being send when multiple emails where being sent at the same time diff --git a/admin/class-mailtpl-admin.php b/admin/class-mailtpl-admin.php index 3c86e76..5785faa 100755 --- a/admin/class-mailtpl-admin.php +++ b/admin/class-mailtpl-admin.php @@ -8,7 +8,7 @@ * * @package Mailtpl * @subpackage Mailtpl/admin - * @author Damian Logghe + * @author wpexperts */ class Mailtpl_Admin { @@ -43,15 +43,133 @@ public function __construct( $plugin_name, $version ) { $this->version = $version; } - + public function email_template() { + $link = $this->get_customizer_link(); + ?> + + +
+
+

+ + Email Templates +

+
+
+
+
+ +

WordPress Email Templates

+

Live preview your WordPress emails.

+

Customize emails to match your brand colors.

+

Customize heading, subtitle, and body text.

+

Design and send custom-built emails with WordPress Email Templates.

+

Choose your template style, add a logo or some text, change colors, edit footer and start sending nice emails in WordPress.

+
+ + + +
+
+
+ +

WooCommerce Email Templates

+

Customize the default transactional emails.

+

Live preview your WooCommerce emails.

+

Export and import your plugin settings.

+

Design and customize WooCommerce's default transactional email templates.

+

Use WordPress's native customizer for visual edits and customize the text (including body text) in WooCommerce without editing code.

+
+ + + +
+
+
+ get_customizer_link(); - add_submenu_page( 'themes.php', 'Email Templates', 'Email Templates', apply_filters( 'mailtpl/roles', 'edit_theme_options'), $link , null ); - + public function add_menu_link() { + + add_menu_page( + esc_html__( 'Email Templates', 'mailtpl-woocommerce-email-composer' ), + esc_html__( 'Email Templates', 'mailtpl-woocommerce-email-composer' ), + 'manage_woocommerce', + 'email-Template', + array( $this,'email_template' ), + 'dashicons-email', + 52 + ); } /** * If we are in our template strip everything out and leave it clean @@ -142,7 +260,7 @@ public function wp_pointers() { wp_enqueue_style( 'wp-pointer' ); // Add pointers script to queue. Add custom script. - wp_enqueue_script( 'mailtpl-pointer', MAILTPL_PLUGIN_URL . '/admin/js/mailtpl-pointer.js', array( 'wp-pointer' ) ); + wp_enqueue_script( 'mailtpl-pointer', MAILTPL_WOOMAIL_URL . '/admin/js/mailtpl-pointer.js', array( 'wp-pointer' ) ); // Add pointer options to script. wp_localize_script( 'mailtpl-pointer', 'mailtpl_pointer', $valid_pointers ); @@ -204,7 +322,7 @@ function woocommerce_integration( $WC_Emails ) { remove_filter( 'mailtpl/email_content', 'convert_chars' ); remove_filter( 'mailtpl/email_content', 'wpautop' ); remove_action('woocommerce_email_header', array($WC_Emails , 'email_header')); - remove_action('woocommerce_email_footer', array($WC_Emails , 'email_footer')); + //remove_action('woocommerce_email_footer', array($WC_Emails , 'email_footer')); } diff --git a/admin/js/mailtpl-admin.js b/admin/js/mailtpl-admin.js index e2f42aa..f19eccd 100755 --- a/admin/js/mailtpl-admin.js +++ b/admin/js/mailtpl-admin.js @@ -1,24 +1,12 @@ (function( $ ) { $(window).load(function () { - - wp.customize.panel( 'mailtpl' ).focus(); $('.mailtpl_range').on('input',function(){ var val = $(this).val(); $(this).parent().find('.font_value').html(val); $(this).val(val); }); - $('#mailtpl-send_mail').on('click', function(e){ - e.preventDefault(); - $('#mailtpl-spinner').fadeIn(); - $.ajax({ - url : ajaxurl, - data : { action: 'mailtpl_send_email' } - }).done(function(data) { - $('#mailtpl-spinner').fadeOut(); - $('#mailtpl-success').fadeIn().delay(3000).fadeOut(); - }); - }); + if( $('#customize-control-mailtpl_template select').val() != 'boxed' ) { $('#customize-control-mailtpl_body_size').hide(); } @@ -31,4 +19,18 @@ }); }); + $( document ).ready( function() { + $(document).on('click', '#mailtpl-send_mail', function(e){ + e.preventDefault(); + $('#mailtpl-spinner').fadeIn(); + $.ajax({ + url : ajaxurl, + data : { action: 'mailtpl_send_email' } + }).done(function(data) { + $('#mailtpl-spinner').fadeOut(); + $('#mailtpl-success').fadeIn().delay(3000).fadeOut(); + }); + }); + } ); + })( jQuery ); diff --git a/admin/templates/partials/default-message.php b/admin/templates/partials/default-message.php index 6563a66..6ebf00e 100644 --- a/admin/templates/partials/default-message.php +++ b/admin/templates/partials/default-message.php @@ -4,7 +4,9 @@

Placeholders

-