Skip to content

Commit 637386d

Browse files
committed
Email Templates v1.4
Email Template 1.4 released.
1 parent f56e30f commit 637386d

File tree

139 files changed

+12352
-86
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+12352
-86
lines changed

README.txt

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
=== Email Templates ===
1+
=== Email Templates Customizer and Designer for WordPress and WooCommerce ===
22
Contributors: wpexpertsio
3-
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
4-
Requires at least: 4.0
5-
Tested up to: 5.9
6-
Stable tag: 1.3.2.1
3+
Tags: Email templates, email designer, email customizer, email, woocommerce email
4+
Requires at least: 7.4
5+
Tested up to: 6.1.1
6+
Stable tag: 1.4
77
License: GPLv2 or later
88
License URI: http://www.gnu.org/licenses/gpl-2.0.html
99

@@ -37,7 +37,8 @@ Send your translations to [Transifex](https://www.transifex.com/projects/p/wp-em
3737

3838
1. Upload the plugin in /wp-admin/plugin-install.php
3939
2. Activate the plugin through the 'Plugins' menu in WordPress
40-
3. Click on Appearance -> "Email Templates" to start editing
40+
3. Click on Email Templates -> "WordPress Email" to start editing
41+
4. Click on Email Templates -> "WooCommerce Email" to start editing
4142

4243
== Frequently Asked Questions ==
4344

@@ -54,9 +55,20 @@ Copy the templates folder into your theme , then in functions.php add the follow
5455
1. Email Templates - Settings
5556
2. Boxed layout
5657
3. Full-width layout
58+
4. Email Notification
59+
5. Email Type
60+
6. Background Color
61+
7. Bundle Icon
62+
8. Send Preview Email
63+
9. Email Type and Text
64+
10. Font Family
65+
11. WooCommerce Emails
5766

5867
== Changelog ==
5968

69+
= 1.4 =
70+
* NEW - WooCommerce Email Customizer Added
71+
6072
= 1.3.2.1 =
6173
* Emails not being send when multiple emails where being sent at the same time
6274

admin/class-mailtpl-admin.php

Lines changed: 126 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
* @package Mailtpl
1010
* @subpackage Mailtpl/admin
11-
* @author Damian Logghe <info@timersys.com>
11+
* @author wpexperts
1212
*/
1313
class Mailtpl_Admin {
1414

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

4545
}
46-
46+
public function email_template() {
47+
$link = $this->get_customizer_link();
48+
?>
49+
<style>
50+
.emailtemplate .container{
51+
display: flex;
52+
}
53+
.emailtemplate .col-md-6 .boxcustom {
54+
background-color: white;
55+
margin-right: 20px;
56+
padding: 10px;
57+
border-radius: 4px;
58+
border: solid #d1d1ff 1px;
59+
transition: box-shadow 0.6s ease-in-out;
60+
-webkit-box-shadow: 2px 3px 9px -2px rgb(126 126 126 / 75%);
61+
-moz-box-shadow: 2px 3px 9px -2px rgb(126 126 126 / 75%);
62+
box-shadow: 2px 3px 9px -2px rgb(126 126 126 / 75%);
63+
text-align: center;
64+
}
65+
.emailtemplate button {
66+
margin-top: 15px;
67+
width: 97%;
68+
height: 45px;
69+
margin-top: 15px;
70+
width: 97%;
71+
height: 45px;
72+
border-radius: 7px;
73+
color: white;
74+
font-weight: 600;
75+
font-size: 18px;
76+
transition: box-shadow 0.6s ease-in-out;
77+
-webkit-box-shadow: 7px 7px 4px -4px rgb(122 122 122 / 75%);
78+
-moz-box-shadow: 7px 7px 4px -4px rgb(122 122 122 / 75%);
79+
box-shadow: 7px 7px 4px -4px rgb(122 122 122 / 75%);
80+
}
81+
.emailtemplate button.wordpress-btn {
82+
background-color: #0073aa;
83+
border: solid #6c6c6c 1px;
84+
}
85+
.emailtemplate button.woocommerce-btn {
86+
background-color: #8053b4;
87+
border: solid #6c6c6c 1px;
88+
}
89+
.boxcustom img {
90+
max-width: 100%;
91+
}
92+
.emailtemplate h2 {
93+
text-align: center;
94+
font-weight: 300;
95+
font-size: 23px;
96+
line-height: 46px;
97+
margin-top: 0px;
98+
}
99+
.headdingemailtemplate {
100+
text-align: center;
101+
margin-top: -10px;
102+
margin-bottom: 8px;
103+
}
104+
.headdingemailtemplate img {
105+
vertical-align:middle;
106+
max-width: 78px;
107+
}
108+
.emailtemplate .col-md-6:hover .boxcustom {
109+
transition: box-shadow 0.6s ease-in-out;
110+
box-shadow: 5px 3px 13px 0px rgb(126 126 126 / 75%);
111+
}
112+
.emailtemplate .col-md-6:hover button {
113+
transition: box-shadow 0.6s ease-in-out;
114+
box-shadow: 6px 5px 7px -1px rgb(126 126 126 / 75%);
115+
}
116+
</style>
117+
118+
<div class="wrap emailtemplate">
119+
<div class="headdingemailtemplate">
120+
<h1>
121+
<img src="<?php echo esc_attr( MAILTPL_WOOMAIL_URL . 'assets/images/icon-128x128.png' ) ?>">
122+
Email Templates
123+
</h1>
124+
</div>
125+
<div class="container">
126+
<div class="col-md-6">
127+
<div class="boxcustom">
128+
<img src="<?php echo esc_attr( MAILTPL_WOOMAIL_URL . 'assets/images/WooCommerce-wordpress-02.png' ) ?>">
129+
<h2 style="border-bottom: solid #54b0d1 1px;">WordPress Email Templates</h2>
130+
<p>Live preview your WordPress emails.</p>
131+
<p>Customize emails to match your brand colors.</p>
132+
<p>Customize heading, subtitle, and body text.</p>
133+
<p>Design and send custom-built emails with WordPress Email Templates.</p>
134+
<p>Choose your template style, add a logo or some text, change colors, edit footer and start sending nice emails in WordPress.</p>
135+
</div>
136+
<a target="_blank" href="<?php echo $link; ?>">
137+
<button class="wordpress-btn">Open WordPress Email Editor</button>
138+
</a>
139+
</div>
140+
<div class="col-md-6">
141+
<div class="boxcustom">
142+
<img src="<?php echo esc_attr( MAILTPL_WOOMAIL_URL . 'assets/images/WooCommerce-wordpress-01.png' ) ?>">
143+
<h2 style="border-bottom: solid #7f54b3 1px;">WooCommerce Email Templates</h2>
144+
<p>Customize the default transactional emails.</p>
145+
<p>Live preview your WooCommerce emails.</p>
146+
<p>Export and import your plugin settings.</p>
147+
<p>Design and customize WooCommerce's default transactional email templates.</p>
148+
<p>Use WordPress's native customizer for visual edits and customize the text (including body text) in WooCommerce without editing code.</p>
149+
</div>
150+
<a target="_blank" href="customize.php?mailtpl-woomail-customize=1&url=<?php echo urlencode( add_query_arg( array( 'mailtpl-woomail-preview' => '1' ), home_url( '/' ) ) ); ?>" >
151+
<button class="woocommerce-btn">Open Woocommerce Email Editor</button>
152+
</a>
153+
</div>
154+
</div>
155+
</div>
156+
<?php
157+
}
47158

48159
/**
49160
* Create the wp-admin menu link
50161
*/
51-
public function add_menu_link() {
52-
$link = $this->get_customizer_link();
53-
add_submenu_page( 'themes.php', 'Email Templates', 'Email Templates', apply_filters( 'mailtpl/roles', 'edit_theme_options'), $link , null );
54-
162+
public function add_menu_link() {
163+
164+
add_menu_page(
165+
esc_html__( 'Email Templates', 'mailtpl-woocommerce-email-composer' ),
166+
esc_html__( 'Email Templates', 'mailtpl-woocommerce-email-composer' ),
167+
'manage_woocommerce',
168+
'email-Template',
169+
array( $this,'email_template' ),
170+
'dashicons-email',
171+
52
172+
);
55173
}
56174
/**
57175
* If we are in our template strip everything out and leave it clean
@@ -142,7 +260,7 @@ public function wp_pointers() {
142260
wp_enqueue_style( 'wp-pointer' );
143261

144262
// Add pointers script to queue. Add custom script.
145-
wp_enqueue_script( 'mailtpl-pointer', MAILTPL_PLUGIN_URL . '/admin/js/mailtpl-pointer.js', array( 'wp-pointer' ) );
263+
wp_enqueue_script( 'mailtpl-pointer', MAILTPL_WOOMAIL_URL . '/admin/js/mailtpl-pointer.js', array( 'wp-pointer' ) );
146264

147265
// Add pointer options to script.
148266
wp_localize_script( 'mailtpl-pointer', 'mailtpl_pointer', $valid_pointers );
@@ -204,7 +322,7 @@ function woocommerce_integration( $WC_Emails ) {
204322
remove_filter( 'mailtpl/email_content', 'convert_chars' );
205323
remove_filter( 'mailtpl/email_content', 'wpautop' );
206324
remove_action('woocommerce_email_header', array($WC_Emails , 'email_header'));
207-
remove_action('woocommerce_email_footer', array($WC_Emails , 'email_footer'));
325+
//remove_action('woocommerce_email_footer', array($WC_Emails , 'email_footer'));
208326
}
209327

210328

admin/js/mailtpl-admin.js

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,12 @@
11
(function( $ ) {
22

33
$(window).load(function () {
4-
5-
wp.customize.panel( 'mailtpl' ).focus();
64
$('.mailtpl_range').on('input',function(){
75
var val = $(this).val();
86
$(this).parent().find('.font_value').html(val);
97
$(this).val(val);
108
});
11-
$('#mailtpl-send_mail').on('click', function(e){
12-
e.preventDefault();
13-
$('#mailtpl-spinner').fadeIn();
14-
$.ajax({
15-
url : ajaxurl,
16-
data : { action: 'mailtpl_send_email' }
17-
}).done(function(data) {
18-
$('#mailtpl-spinner').fadeOut();
19-
$('#mailtpl-success').fadeIn().delay(3000).fadeOut();
20-
});
21-
});
9+
2210
if( $('#customize-control-mailtpl_template select').val() != 'boxed' ) {
2311
$('#customize-control-mailtpl_body_size').hide();
2412
}
@@ -31,4 +19,18 @@
3119
});
3220
});
3321

22+
$( document ).ready( function() {
23+
$(document).on('click', '#mailtpl-send_mail', function(e){
24+
e.preventDefault();
25+
$('#mailtpl-spinner').fadeIn();
26+
$.ajax({
27+
url : ajaxurl,
28+
data : { action: 'mailtpl_send_email' }
29+
}).done(function(data) {
30+
$('#mailtpl-spinner').fadeOut();
31+
$('#mailtpl-success').fadeIn().delay(3000).fadeOut();
32+
});
33+
});
34+
} );
35+
3436
})( jQuery );

admin/templates/partials/default-message.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44

55
<h3>Placeholders</h3>
66
<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>
7-
<ul>
7+
<ul style=" <?php if ( ! is_customize_preview() ) {
8+
echo "color: {$settings['header_text_color']}";
9+
} ?>">
810
<li>%%BLOG_URL%%</li>
911
<li>%%HOME_URL%%</li>
1012
<li>%%BLOG_NAME%%</li>

admin/templates/partials/footer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* @version 1.0
66
* @since 1.4
77
* @package Wordpress Social Invitations
8-
* @author Timersys
8+
* @author wpexpert
99
*/
1010
if ( ! defined( 'ABSPATH' ) ) exit;
1111
$border_radius = $settings['template'] == 'boxed' ? '6px' : '0px';

admin/templates/partials/header.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* @version 1.0
66
* @since 1.4
77
* @package Wordpress Social Invitations
8-
* @author Timersys
8+
* @author wpexpert
99
*/
1010
if ( ! defined( 'ABSPATH' ) ) exit;
1111

0 commit comments

Comments
 (0)