Skip to content

Commit

Permalink
Email Templates v1.4
Browse files Browse the repository at this point in the history
Email Template 1.4 released.
  • Loading branch information
wpexpertsio committed Dec 16, 2022
1 parent f56e30f commit 637386d
Show file tree
Hide file tree
Showing 139 changed files with 12,352 additions and 86 deletions.
24 changes: 18 additions & 6 deletions README.txt
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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 ==

Expand All @@ -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

Expand Down
134 changes: 126 additions & 8 deletions admin/class-mailtpl-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
* @package Mailtpl
* @subpackage Mailtpl/admin
* @author Damian Logghe <[email protected]>
* @author wpexperts
*/
class Mailtpl_Admin {

Expand Down Expand Up @@ -43,15 +43,133 @@ public function __construct( $plugin_name, $version ) {
$this->version = $version;

}

public function email_template() {
$link = $this->get_customizer_link();
?>
<style>
.emailtemplate .container{
display: flex;
}
.emailtemplate .col-md-6 .boxcustom {
background-color: white;
margin-right: 20px;
padding: 10px;
border-radius: 4px;
border: solid #d1d1ff 1px;
transition: box-shadow 0.6s ease-in-out;
-webkit-box-shadow: 2px 3px 9px -2px rgb(126 126 126 / 75%);
-moz-box-shadow: 2px 3px 9px -2px rgb(126 126 126 / 75%);
box-shadow: 2px 3px 9px -2px rgb(126 126 126 / 75%);
text-align: center;
}
.emailtemplate button {
margin-top: 15px;
width: 97%;
height: 45px;
margin-top: 15px;
width: 97%;
height: 45px;
border-radius: 7px;
color: white;
font-weight: 600;
font-size: 18px;
transition: box-shadow 0.6s ease-in-out;
-webkit-box-shadow: 7px 7px 4px -4px rgb(122 122 122 / 75%);
-moz-box-shadow: 7px 7px 4px -4px rgb(122 122 122 / 75%);
box-shadow: 7px 7px 4px -4px rgb(122 122 122 / 75%);
}
.emailtemplate button.wordpress-btn {
background-color: #0073aa;
border: solid #6c6c6c 1px;
}
.emailtemplate button.woocommerce-btn {
background-color: #8053b4;
border: solid #6c6c6c 1px;
}
.boxcustom img {
max-width: 100%;
}
.emailtemplate h2 {
text-align: center;
font-weight: 300;
font-size: 23px;
line-height: 46px;
margin-top: 0px;
}
.headdingemailtemplate {
text-align: center;
margin-top: -10px;
margin-bottom: 8px;
}
.headdingemailtemplate img {
vertical-align:middle;
max-width: 78px;
}
.emailtemplate .col-md-6:hover .boxcustom {
transition: box-shadow 0.6s ease-in-out;
box-shadow: 5px 3px 13px 0px rgb(126 126 126 / 75%);
}
.emailtemplate .col-md-6:hover button {
transition: box-shadow 0.6s ease-in-out;
box-shadow: 6px 5px 7px -1px rgb(126 126 126 / 75%);
}
</style>

<div class="wrap emailtemplate">
<div class="headdingemailtemplate">
<h1>
<img src="<?php echo esc_attr( MAILTPL_WOOMAIL_URL . 'assets/images/icon-128x128.png' ) ?>">
Email Templates
</h1>
</div>
<div class="container">
<div class="col-md-6">
<div class="boxcustom">
<img src="<?php echo esc_attr( MAILTPL_WOOMAIL_URL . 'assets/images/WooCommerce-wordpress-02.png' ) ?>">
<h2 style="border-bottom: solid #54b0d1 1px;">WordPress Email Templates</h2>
<p>Live preview your WordPress emails.</p>
<p>Customize emails to match your brand colors.</p>
<p>Customize heading, subtitle, and body text.</p>
<p>Design and send custom-built emails with WordPress Email Templates.</p>
<p>Choose your template style, add a logo or some text, change colors, edit footer and start sending nice emails in WordPress.</p>
</div>
<a target="_blank" href="<?php echo $link; ?>">
<button class="wordpress-btn">Open WordPress Email Editor</button>
</a>
</div>
<div class="col-md-6">
<div class="boxcustom">
<img src="<?php echo esc_attr( MAILTPL_WOOMAIL_URL . 'assets/images/WooCommerce-wordpress-01.png' ) ?>">
<h2 style="border-bottom: solid #7f54b3 1px;">WooCommerce Email Templates</h2>
<p>Customize the default transactional emails.</p>
<p>Live preview your WooCommerce emails.</p>
<p>Export and import your plugin settings.</p>
<p>Design and customize WooCommerce's default transactional email templates.</p>
<p>Use WordPress's native customizer for visual edits and customize the text (including body text) in WooCommerce without editing code.</p>
</div>
<a target="_blank" href="customize.php?mailtpl-woomail-customize=1&url=<?php echo urlencode( add_query_arg( array( 'mailtpl-woomail-preview' => '1' ), home_url( '/' ) ) ); ?>" >
<button class="woocommerce-btn">Open Woocommerce Email Editor</button>
</a>
</div>
</div>
</div>
<?php
}

/**
* Create the wp-admin menu link
*/
public function add_menu_link() {
$link = $this->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
Expand Down Expand Up @@ -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 );
Expand Down Expand Up @@ -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'));
}


Expand Down
28 changes: 15 additions & 13 deletions admin/js/mailtpl-admin.js
Original file line number Diff line number Diff line change
@@ -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();
}
Expand All @@ -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 );
4 changes: 3 additions & 1 deletion admin/templates/partials/default-message.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

<h3>Placeholders</h3>
<p><?php _e( 'You can use any of these placeholders in your emails content or templates and they will be automatically replaced', 'email-templates');?></p>
<ul>
<ul style=" <?php if ( ! is_customize_preview() ) {
echo "color: {$settings['header_text_color']}";
} ?>">
<li>%%BLOG_URL%%</li>
<li>%%HOME_URL%%</li>
<li>%%BLOG_NAME%%</li>
Expand Down
2 changes: 1 addition & 1 deletion admin/templates/partials/footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @version 1.0
* @since 1.4
* @package Wordpress Social Invitations
* @author Timersys
* @author wpexpert
*/
if ( ! defined( 'ABSPATH' ) ) exit;
$border_radius = $settings['template'] == 'boxed' ? '6px' : '0px';
Expand Down
2 changes: 1 addition & 1 deletion admin/templates/partials/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @version 1.0
* @since 1.4
* @package Wordpress Social Invitations
* @author Timersys
* @author wpexpert
*/
if ( ! defined( 'ABSPATH' ) ) exit;

Expand Down
Loading

0 comments on commit 637386d

Please sign in to comment.