From 4a254b8443e6b9a35c147ead43df983039e37e17 Mon Sep 17 00:00:00 2001 From: Damian Logghe Date: Mon, 13 Jun 2016 13:12:48 -0300 Subject: [PATCH 01/13] logo text color --- admin/js/mailtpl-public.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/js/mailtpl-public.js b/admin/js/mailtpl-public.js index f35537a..9f201bd 100755 --- a/admin/js/mailtpl-public.js +++ b/admin/js/mailtpl-public.js @@ -50,7 +50,7 @@ wp.customize( 'mailtpl_opts[header_text_color]', function( value ) { value.bind( function( newval ) { if( newval.length ) - $( '#logo' ).css( 'color', newval ); + $( '#logo a' ).css( 'color', newval ); } ); } ); From 0bb272ebf62489e6e6588472c85c2794bdb46919 Mon Sep 17 00:00:00 2001 From: Damian Logghe Date: Fri, 3 Mar 2017 11:15:48 -0300 Subject: [PATCH 02/13] Added args to filters --- includes/class-mailtpl-mailer.php | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/includes/class-mailtpl-mailer.php b/includes/class-mailtpl-mailer.php index 2ed7849..e42a7da 100755 --- a/includes/class-mailtpl-mailer.php +++ b/includes/class-mailtpl-mailer.php @@ -70,20 +70,20 @@ function send_email( &$phpmailer ) { do_action( 'mailtpl/send_email', $phpmailer, $this ); $message = $this->add_template( apply_filters( 'mailtpl/email_content', $phpmailer->Body ) ); $phpmailer->AltBody = $this->replace_placeholders( strip_tags($phpmailer->Body) ); - $phpmailer->Body = $this->replace_placeholders( $message ); + $phpmailer->Body = $this->replace_placeholders( $message, $phpmailer ); } /** - * Mandrill Compatibility + * Generic Compatibility functions used for Mandrill,Mailgun, etc * @param $message Array * * @return Array */ - public function send_email_mandrill( $message ) { - do_action( 'mailtpl/send_email_mandrill', $message, $this ); + public function send_email_generic( $message ) { + do_action( 'mailtpl/send_email_generic', $message, $this ); $temp_message = $this->add_template( apply_filters( 'mailtpl/email_content', $message['html'] ) ); - $message['html'] = $this->replace_placeholders( $temp_message ); + $message['html'] = $this->replace_placeholders( $temp_message, $message ); return $message; } @@ -100,7 +100,7 @@ public function send_email_postman( $args ) { return $args; do_action( 'mailtpl/send_email_postman', $args, $this ); $temp_message = $this->add_template( apply_filters( 'mailtpl/email_content', $args['message'] ) ); - $args['message'] = $this->replace_placeholders( $temp_message ); + $args['message'] = $this->replace_placeholders( $temp_message, $args ); return $args; } @@ -142,11 +142,15 @@ private function add_template( $email ) { /** * Replace placeholders + * * @param $email string Mail to be send * + * @param $message array Could be plugin email arguments array or phpmailer instance. + * Passed to the filters in case users needs something + * * @return string */ - private function replace_placeholders( $email ) { + private function replace_placeholders( $email, $message = array() ) { $to_replace = apply_filters( 'emailtpl/placeholders', array( '%%BLOG_URL%%' => get_option( 'siteurl' ), @@ -156,7 +160,7 @@ private function replace_placeholders( $email ) { '%%ADMIN_EMAIL%%' => get_option( 'admin_email' ), '%%DATE%%' => date_i18n( get_option( 'date_format' ) ), '%%TIME%%' => date_i18n( get_option( 'time_format' ) ) - )); + ), $message); foreach ( $to_replace as $placeholder => $var ) { $email = str_replace( $placeholder , $var, $email ); From 30e9f1aa7667ee5b8f1f3bcc389cde3c6b031360 Mon Sep 17 00:00:00 2001 From: Damian Logghe Date: Fri, 3 Mar 2017 11:16:15 -0300 Subject: [PATCH 03/13] filters for mailgun --- includes/class-mailtpl.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/includes/class-mailtpl.php b/includes/class-mailtpl.php index d3efbba..c589e43 100755 --- a/includes/class-mailtpl.php +++ b/includes/class-mailtpl.php @@ -181,8 +181,8 @@ private function define_hooks() { $this->loader->add_action( 'edd_email_send_before', $this->admin, 'edd_get_template' ); $this->loader->add_action( 'woocommerce_email', $this->admin, 'woocommerce_integration' ); $this->loader->add_filter( 'woocommerce_email_settings', $this->admin, 'woocommerce_preview_link' ); - - // only show in customizer if being acceded by our menu link + + // only show in customizer if being acceded by our menu link if( defined( 'DOING_AJAX' ) || ( isset( $_GET['mailtpl_display'] ) && 'true' == $_GET['mailtpl_display'] ) ) { $this->loader->add_action( 'customize_register', $this->customizer, 'register_customize_sections' ); $this->loader->add_action( 'customize_section_active', $this->customizer, 'remove_other_sections', 10, 2 ); @@ -190,16 +190,15 @@ private function define_hooks() { $this->loader->add_action( 'template_include', $this->customizer, 'capture_customizer_page' ); } - $this->loader->add_action( 'phpmailer_init', $this->mailer, 'send_email' ); - $this->loader->add_filter( 'mandrill_payload', $this->mailer, 'send_email_mandrill' ); - + $this->loader->add_action( 'phpmailer_init', $this->mailer, 'send_email', 50 ); + $this->loader->add_filter( 'mandrill_payload', $this->mailer, 'send_email_generic' ); + $this->loader->add_filter( 'mg_mutate_message_body', $this->mailer, 'send_email_generic' ); $this->loader->add_filter( 'wp_mail', $this->mailer, 'send_email_postman' ); - $this->loader->add_action( 'mandrill_payload', $this->mailer, 'send_email_mandrill' ); $this->loader->add_action( 'wp_ajax_mailtpl_send_email', $this->mailer, 'send_test_email' ); $this->loader->add_action( 'wp_mail_content_type', $this->mailer, 'set_content_type', 100 ); $this->loader->add_action( 'wp_mail_from_name', $this->mailer, 'set_from_name' ); - $this->loader->add_action( 'wp_mail_from', $this->mailer, 'set_from_email' ); + $this->loader->add_action( 'wp_mail_from', $this->mailer, 'set_from_email'); $this->loader->add_filter( 'mailtpl/email_content', $this->mailer, 'clean_retrieve_password' ); From 820388880ed2b387982ca24bfde5d610cd5bb90d Mon Sep 17 00:00:00 2001 From: Damian Logghe Date: Thu, 16 Mar 2017 09:03:05 -0300 Subject: [PATCH 04/13] sengrid integration --- includes/class-mailtpl.php | 1 + 1 file changed, 1 insertion(+) diff --git a/includes/class-mailtpl.php b/includes/class-mailtpl.php index c589e43..8a5ef9a 100755 --- a/includes/class-mailtpl.php +++ b/includes/class-mailtpl.php @@ -193,6 +193,7 @@ private function define_hooks() { $this->loader->add_action( 'phpmailer_init', $this->mailer, 'send_email', 50 ); $this->loader->add_filter( 'mandrill_payload', $this->mailer, 'send_email_generic' ); $this->loader->add_filter( 'mg_mutate_message_body', $this->mailer, 'send_email_generic' ); + $this->loader->add_filter( 'sendgrid_mail_html', $this->mailer, 'send_email_generic' ); $this->loader->add_filter( 'wp_mail', $this->mailer, 'send_email_postman' ); $this->loader->add_action( 'wp_ajax_mailtpl_send_email', $this->mailer, 'send_test_email' ); From ca973f310a0c5abab18fb777dd7a168eb242124e Mon Sep 17 00:00:00 2001 From: Damian Logghe Date: Wed, 5 Apr 2017 10:45:20 -0300 Subject: [PATCH 05/13] custom css + link color --- admin/js/mailtpl-public.js | 13 +++++++++- admin/templates/partials/header.php | 9 ++++++- includes/class-mailtpl-customizer.php | 35 +++++++++++++++++++++++++++ includes/class-mailtpl.php | 4 ++- 4 files changed, 58 insertions(+), 3 deletions(-) diff --git a/admin/js/mailtpl-public.js b/admin/js/mailtpl-public.js index 9f201bd..7263cfc 100755 --- a/admin/js/mailtpl-public.js +++ b/admin/js/mailtpl-public.js @@ -14,6 +14,12 @@ $( '#template_container' ).css( 'width', newval + 'px' ); } ); } ); + wp.customize( 'mailtpl_opts[custom_css]', function( value ) { + value.bind( function( newval ) { + if( newval.length ) + $( '#custom-css' ).html( newval ); + } ); + } ); wp.customize( 'mailtpl_opts[header_logo]', function( value ) { value.bind( function( newval ) { if( newval.length ) { @@ -72,7 +78,12 @@ $( '#mailtpl_body' ).css( 'color', newval ); } ); } ); - + wp.customize( 'mailtpl_opts[body_href_color]', function( value ) { + value.bind( function( newval ) { + if( newval.length ) + $( '#template_body a' ).css( 'color', newval ); + } ); + } ); wp.customize( 'mailtpl_opts[footer_aligment]', function( value ) { value.bind( function( newval ) { if( newval.length ) diff --git a/admin/templates/partials/header.php b/admin/templates/partials/header.php index ba2fec1..a298b61 100644 --- a/admin/templates/partials/header.php +++ b/admin/templates/partials/header.php @@ -65,11 +65,18 @@ text-decoration: none; "; ?> - <?php echo get_bloginfo('name'); ?> + +
diff --git a/includes/class-mailtpl-customizer.php b/includes/class-mailtpl-customizer.php index 4440ff5..f49cf32 100755 --- a/includes/class-mailtpl-customizer.php +++ b/includes/class-mailtpl-customizer.php @@ -286,6 +286,24 @@ private function template_section($wp_customize) { 'description' => __( 'Choose email background color', $this->plugin_name ) ) ) ); + // custom css + $wp_customize->add_setting( 'mailtpl_opts[custom_css]', array( + 'type' => 'option', + 'default' => $this->defaults['custom_css'], + 'transport' => 'refresh', + 'capability' => 'edit_theme_options', + 'sanitize_callback' => 'wp_filter_nohtml_kses', + 'sanitize_js_callback' => 'wp_filter_nohtml_kses', + ) ); + $wp_customize->add_control( new WP_Customize_Control( $wp_customize, + 'mailtpl_custom_css', array( + 'label' => __( 'Custom css', $this->plugin_name ), + 'type' => 'textarea', + 'section' => 'section_mailtpl_template', + 'settings' => 'mailtpl_opts[custom_css]', + 'description' => __('Add custom css. Be aware that this may not work on all email clients.', $this->plugin_name ) + ) + ) ); do_action('mailtpl/sections/template/after_content', $wp_customize); } @@ -477,6 +495,23 @@ private function body_section( $wp_customize ) { 'description' => __( 'Choose body text color', $this->plugin_name ) ) ) ); + // Links color + $wp_customize->add_setting( 'mailtpl_opts[body_href_color]', array( + 'type' => 'option', + 'default' => $this->defaults['body_href_color'], + 'transport' => 'postMessage', + 'capability' => 'edit_theme_options', + 'sanitize_callback' => 'sanitize_hex_color', + 'sanitize_js_callback' => '', + ) ); + $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, + 'mailtpl_body_href_color', array( + 'label' => __( 'Links Color', $this->plugin_name ), + 'section' => 'section_mailtpl_body', + 'settings' => 'mailtpl_opts[body_href_color]', + 'description' => __( 'Choose links color', $this->plugin_name ) + ) + ) ); do_action('mailtpl/sections/body/after_content', $wp_customize); } diff --git a/includes/class-mailtpl.php b/includes/class-mailtpl.php index 8a5ef9a..4979fde 100755 --- a/includes/class-mailtpl.php +++ b/includes/class-mailtpl.php @@ -211,7 +211,7 @@ private function define_hooks() { $this->loader->add_action( 'customize_controls_enqueue_scripts', $this->customizer, 'enqueue_scripts' ); $this->loader->add_action( 'customize_preview_init', $this->customizer, 'enqueue_template_scripts', 99 ); - $this->loader->add_action( 'init', $this->admin, 'remove_all_actions', 99 ); + $this->loader->add_action( 'init', $this->admin, 'remove_all_actions', 999 ); } } @@ -289,6 +289,8 @@ public static function defaults() { 'email_body_bg' => '#fafafa', 'body_text_size' => '14', 'body_text_color' => '#888', + 'body_href_color' => '#4ca6cf', + 'custom_css' => '', )); } } From 46cc05744ca76ba76bbded744146e028d2471279 Mon Sep 17 00:00:00 2001 From: Damian Logghe Date: Wed, 5 Apr 2017 10:48:58 -0300 Subject: [PATCH 06/13] version BUMP + german --- README.txt | 14 +++++++++++--- languages/mailtpl-de_DE.mo | Bin 2130 -> 5020 bytes mailtpl.php | 4 ++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/README.txt b/README.txt index 2f3992f..d296317 100755 --- a/README.txt +++ b/README.txt @@ -3,8 +3,8 @@ Contributors: timersys Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=K4T6L69EV9G2Q Tags: email templates, email template, html email, email template, template, better emails, wp better emails, wp email templates, html emails, wpmandrill, postman, wp smtp, woocommerce, easy digital downloads Requires at least: 4.0 -Tested up to: 4.5 -Stable tag: 1.1.4 +Tested up to: 4.7.3 +Stable tag: 1.2 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -15,7 +15,7 @@ Send beautiful emails with the WordPress Email Templates plugin. Choose your tem Email Template plugin uses Customizer to make it easier. Preview your changes or send a test email with just a few clicks. **Requires WordPress 4.0.0** -Compatible with : [wpMandrill](https://wordpress.org/plugins/wpmandrill/), [Postman SMTP Mailer](https://wordpress.org/support/plugin/postman-smtp), [WP SMTP](https://wordpress.org/plugins/wp-smtp/), [Easy WP SMTP](https://wordpress.org/plugins/easy-wp-smtp/), [Easy SMTP Mail](https://wordpress.org/plugins/webriti-smtp-mail/) +Compatible with : [wpMandrill](https://wordpress.org/plugins/wpmandrill/), [Postman SMTP Mailer](https://wordpress.org/support/plugin/postman-smtp), [WP SMTP](https://wordpress.org/plugins/wp-smtp/), [Easy WP SMTP](https://wordpress.org/plugins/easy-wp-smtp/), [Easy SMTP Mail](https://wordpress.org/plugins/webriti-smtp-mail/), [Mailgun](https://wordpress.org/plugins/mailgun/), [Sengrid](https://wordpress.org/plugins/sendgrid-email-delivery-simplified/) = Help with translations = @@ -29,6 +29,8 @@ Send your translations to [Transifex](https://www.transifex.com/projects/p/wp-em * Portuguese * Dutch * Persian +* Russian +* German = Collaborate in Github = - [https://github.com/timersys/wordpress-email-templates](https://github.com/timersys/wordpress-email-templates) @@ -50,6 +52,12 @@ Thanks to @eliorivero for sharing some customizer tips for plugins :) == Changelog == += 1.2 = +* Added custom css support on template section +* Added link color in body section +* Updated templates with changes above +* Mailgun / sengrid integration + = 1.1.4 = * Added body size to template section diff --git a/languages/mailtpl-de_DE.mo b/languages/mailtpl-de_DE.mo index 51c636aab3d98e692e2233d3a96e1fc966ff4490..c29e9c4c9e996378e04931e5360504197d32dbd1 100644 GIT binary patch literal 5020 zcmai1ON<;x8LmJGWHFE!LY(j_ud%ZW^vtYd%gfm7uut!j-FV3^UX#mGGhH*?p6;rl zs(Qz>hn$cQ;utt^i4U=a04ahC2+0ycb3+0Y4jh8S0SSEIfO6vC1AKpV&BJS(w6^E# zdjJ3TKkDDV9e?~s3{MsBXYu~@x5%iB6PXT`u z#(xj|B-(d@p8?(r`0R%m`!w1w0zU`*I&d1806!1>0q_LyXQ4d^?Y{%3(0>p3B=CtR z7&`-e3P}AIfX9GKz)t|L0zV4e2jY))LfZgo{_8;6=lj4bz&AqwUx5&n{S!$0{0q1U zycfn7KFruQ+Ur1?_hTTAwEhzCY2Z2#f9y5rKsx_P9DW`64Ddam0{#;CZIDj99|vg%z|%muzV}&@XZSpi z4^ZtN+IRRogO4g+Z0G%$WT5ltA-TTdzsjE%0B~Rbkgt&cQ!GtBm5Bz~hirZlFNI-* zmtyBxykt{)zKj=c;vcd*$4hZU9Ka<0A-?D#yMEDsm9{4P(L;6u&7KGH5m4qiC;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o{7d@v|jZB|Fi7qx|5CE3Jszv zccB!kwZ-!kC1m}iPsJ#Y9F=}vl6J?%TJ4mFWL;v-nnKnJnxT#g5*wM`@qulap%I&t zeo6(&OCy&VU5bllEGMRtaik?Bnd6D|fje(m+H9CQndv$yOQR7*HqtT4f^;RWkWT6k zyeM5Gin(){9+qP2Jq8H3$#6X^vt1Ied&?Da8tI8N12%yPB919FInq$F;h9$@a;6<} zAdQ7ZpBqRgEIN_nEYIaO)K$(Dk;~#J&nMDStuYZjYu=>TsSAm^3f;&-D6fs0w8^Qn zWvh3oua+%A-e|Rg?1yqL=)S0em(*M!yFobDRl)N?fQ{-hy`8b5*}hXMm{UPlcIU$G z3(dZbsC252w3Vo(v7y||bS7Ue@GaZhmEDPKa%RZYZ^x!M-P*t*tfC>QK1D?+&yg)q zp%bZdqp;H%kH>At%CZ4nXMv8(3WPH$JL8e6kFDCzO(*xdItg`7wl*(puFhibwu9Dk zlTg*4j1VWEr4F){=>-|5kuAwBzS>_?^RsewVGb13JxGq>+^C=+V+^2$cJ zS~IpNL#apgv|OB9Ky7(t@r0Jg7iIV4LhChkjx^aOFFjKq!)|-NeF`hhRGp1V8bvM* zWqbB>ohD;rlX4>~ad)=17Pe@%cm;;<67SyG>&6hQej26`%tji=2rtA{qkWk5@Z$7=Xp+&q z4~VqU?4JnI;uUhcPVPin<9;U+0Z1=;7k*rcussG3>Jwg!itg+6B!k(x95n kik99poMg9)N|KiR#-q~EH71+j$MlUT<5c4IaF}iJC$I=a!~g&Q diff --git a/mailtpl.php b/mailtpl.php index 3a358fe..9c85b46 100755 --- a/mailtpl.php +++ b/mailtpl.php @@ -11,7 +11,7 @@ * Plugin Name: Email Templates * Plugin URI: http://wordpress.org/plugins/email-templates * Description: Beautify WordPress default emails - * Version: 1.1.4 + * Version: 1.2 * Author: Damian Logghe * Author URI: https://wp.timersys.com * License: GPL-2.0+ @@ -25,7 +25,7 @@ die; } -define( 'MAILTPL_VERSION' , '1.1.4'); +define( 'MAILTPL_VERSION' , '1.2'); define( 'MAILTPL_PLUGIN_FILE' , __FILE__); define( 'MAILTPL_PLUGIN_DIR' , plugin_dir_path(__FILE__) ); define( 'MAILTPL_PLUGIN_URL' , plugin_dir_url(__FILE__) ); From 3f789959e90679be9e7a37cd0f7d88fdf5d8a51d Mon Sep 17 00:00:00 2001 From: Damian Logghe Date: Wed, 5 Apr 2017 10:51:58 -0300 Subject: [PATCH 07/13] renamed russian and removed po --- languages/{ru_RU.mo => mailtpl-ru_RU.mo} | Bin languages/ru_RU.po | 243 ----------------------- 2 files changed, 243 deletions(-) rename languages/{ru_RU.mo => mailtpl-ru_RU.mo} (100%) delete mode 100644 languages/ru_RU.po diff --git a/languages/ru_RU.mo b/languages/mailtpl-ru_RU.mo similarity index 100% rename from languages/ru_RU.mo rename to languages/mailtpl-ru_RU.mo diff --git a/languages/ru_RU.po b/languages/ru_RU.po deleted file mode 100644 index ae5c8ed..0000000 --- a/languages/ru_RU.po +++ /dev/null @@ -1,243 +0,0 @@ -msgid "" -msgstr "" -"Project-Id-Version: Email Templates\n" -"POT-Creation-Date: 2015-09-20 10:21-0300\n" -"PO-Revision-Date: 2016-10-06 07:00+0300\n" -"Language-Team: Timersys \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 1.8.9\n" -"X-Poedit-Basepath: .\n" -"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" -"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" -"X-Poedit-KeywordsList: __;_e\n" -"Last-Translator: \n" -"Language: ru_RU\n" -"X-Poedit-SearchPath-0: ../.\n" - -#: .././admin/class-mailtpl-admin.php:169 -#: .././includes/class-mailtpl-customizer.php:55 -msgid "Email Templates" -msgstr "Шаблоны писем" - -#: .././admin/class-mailtpl-admin.php:170 -msgid "Now you can edit your email template right in the Appearance menu" -msgstr "" -"Теперь вы можете редактировать Ваш шаблон письма прямо в меню «Внешний вид»" - -#: .././admin/templates/partials/default-message.php:1 -msgid "Here you will see the email content that is normally sent in WordPress." -msgstr "" -"Здесь Вы видите содержимое письма, которое обычно отправляется в WordPress." - -#: .././admin/templates/partials/default-message.php:2 -msgid "" -"The email template is responsive an fully customizable. I hope you enjoy it!" -msgstr "" -"Шаблон письма адаптивный и полностью настраиваемый. Я надеюсь, вам " -"понравится!" - -#: .././admin/templates/partials/default-message.php:3 -#, php-format -msgid "" -"We would like to ask you a little favour. If you are happy with the plugin " -"and can take a minute please leave a nice " -"review on WordPress. It will be a tremendous help for us!" -msgstr "" -"Мы хотели бы попросить Вас о небольшом одолжении. Если вы довольно плагином, " -"вы можете потратить одну минуту и оставить хороший отзыв в WordPress. Это будет огромная помощь для нас!" - -#: .././admin/templates/partials/default-message.php:6 -msgid "" -"You can use any of these placeholders in your emails content or templates " -"and they will be automatically replaced" -msgstr "" -"Вы можете использоваться любой из этих плейсхолдеров в содержимом Вашего " -"письма или шаблона, они будут автоматически заменены" - -#: .././admin/test.php:25 -msgid "MyTheme Options" -msgstr "Опции MyTheme" - -#: .././admin/test.php:28 -msgid "Allows you to customize some example settings for MyTheme." -msgstr "Позволяет вам настраивать некоторые параметры для MyTheme." - -#: .././admin/test.php:47 -msgid "Link Color" -msgstr "Цвет ссылок" - -#: .././includes/class-mailtpl-customizer.php:56 -msgid "" -"Within the Email Templates customizer you can change how your WordPress " -"Emails looks. It's fully compatible with WooCommerce and Easy Digital " -"Downloads html emails" -msgstr "" -"С помощью Email Templates customizer, Вы можете изменить внешний вид Ваших " -"писем в WordPress. Он полностью совместим с сообщениями от WooCommerce и " -"Easy Digital Downloads." - -#: .././includes/class-mailtpl-customizer.php:62 -msgid "Settings" -msgstr "Настройки" - -#: .././includes/class-mailtpl-customizer.php:66 -msgid "Template" -msgstr "Шаблон" - -#: .././includes/class-mailtpl-customizer.php:70 -msgid "Email Header" -msgstr "Заголовок письма" - -#: .././includes/class-mailtpl-customizer.php:74 -msgid "Email Body" -msgstr "Тело письма" - -#: .././includes/class-mailtpl-customizer.php:78 -msgid "Footer" -msgstr "Нижняя часть" - -#: .././includes/class-mailtpl-customizer.php:82 -#: .././includes/class-mailtpl-customizer.php:601 -msgid "Send test email" -msgstr "Отправить тестовое письмо" - -#: .././includes/class-mailtpl-customizer.php:179 -msgid "From name" -msgstr "От кого" - -#: .././includes/class-mailtpl-customizer.php:183 -#: .././includes/class-mailtpl-customizer.php:201 -msgid "Default: " -msgstr "По умолчанию: " - -#: .././includes/class-mailtpl-customizer.php:197 -msgid "From Email" -msgstr "Адрес отправителя" - -#: .././includes/class-mailtpl-customizer.php:228 -msgid "Choose one" -msgstr "Выберите опцию" - -#: .././includes/class-mailtpl-customizer.php:250 -#: .././includes/class-mailtpl-customizer.php:341 -#: .././includes/class-mailtpl-customizer.php:405 -#: .././includes/class-mailtpl-customizer.php:514 -msgid "Background Color" -msgstr "Цвет фона" - -#: .././includes/class-mailtpl-customizer.php:253 -msgid "Choose email background color" -msgstr "Выберите цвет фона для письма" - -#: .././includes/class-mailtpl-customizer.php:279 -#: .././includes/class-mailtpl-customizer.php:298 -msgid "Logo" -msgstr "Логотип" - -#: .././includes/class-mailtpl-customizer.php:283 -msgid "Add an image to use in header. Leave empty to use text instead" -msgstr "" -"Добавьте картинку для использования в шапке. Оставьте поле пустым для " -"использования текста" - -#: .././includes/class-mailtpl-customizer.php:302 -msgid "Add text to your mail header" -msgstr "Добавьте текст в шапку Вашего письма" - -#: .././includes/class-mailtpl-customizer.php:316 -#: .././includes/class-mailtpl-customizer.php:489 -msgid "Aligment" -msgstr "Выравнивание" - -#: .././includes/class-mailtpl-customizer.php:326 -msgid "Choose alignment for header" -msgstr "Выберите выравнивание для шапки" - -#: .././includes/class-mailtpl-customizer.php:344 -msgid "Choose header background color" -msgstr "Выберите цвета фона для шапки" - -#: .././includes/class-mailtpl-customizer.php:358 -#: .././includes/class-mailtpl-customizer.php:422 -#: .././includes/class-mailtpl-customizer.php:531 -msgid "Text size" -msgstr "Размер шрифта" - -#: .././includes/class-mailtpl-customizer.php:362 -#: .././includes/class-mailtpl-customizer.php:426 -#: .././includes/class-mailtpl-customizer.php:535 -msgid "Slide to change text size" -msgstr "Двигайте ползунок для изменения размера текста" - -#: .././includes/class-mailtpl-customizer.php:377 -#: .././includes/class-mailtpl-customizer.php:441 -#: .././includes/class-mailtpl-customizer.php:549 -msgid "Text Color" -msgstr "Цвет текста" - -#: .././includes/class-mailtpl-customizer.php:380 -msgid "Choose header text color" -msgstr "Выберите цвет текста в шапке" - -#: .././includes/class-mailtpl-customizer.php:408 -msgid "Choose email body background color" -msgstr "Выберите цвет фона для тела письма" - -#: .././includes/class-mailtpl-customizer.php:444 -msgid "Choose body text color" -msgstr "Выберите цвет текста для тела письма" - -#: .././includes/class-mailtpl-customizer.php:470 -msgid "Footer text" -msgstr "Текст в нижней части письма" - -#: .././includes/class-mailtpl-customizer.php:474 -msgid "Change the email footer here" -msgstr "Измените нижнюю часть письма здесь" - -#: .././includes/class-mailtpl-customizer.php:499 -msgid "Choose alignment for footer" -msgstr "Выберите выравнивание для нижней части письма" - -#: .././includes/class-mailtpl-customizer.php:517 -msgid "Choose footer background color" -msgstr "Выберите цвет фона для нижней части письма" - -#: .././includes/class-mailtpl-customizer.php:552 -msgid "Choose footer text color" -msgstr "Выберите цвет текста для нижней части письма" - -#: .././includes/class-mailtpl-customizer.php:567 -msgid "Powered by" -msgstr "Работает с помощью" - -#: .././includes/class-mailtpl-customizer.php:575 -msgid "Display a tiny link to the plugin page" -msgstr "Показывать короткую ссылку на страницу плагина" - -#: .././includes/class-mailtpl-customizer.php:605 -msgid "" -"Save the template and then click the button to send a test email to admin " -"email " -msgstr "" -"Сохраните шаблон и затем нажмите кнопку для отправки тестового письма на " -"почту администратора " - -#: .././includes/class-mailtpl-mailer.php:114 -msgid "Wp Email Templates" -msgstr "WP Шаблоны писем" - -#: .././includes/class-mailtpl.php:80 .././includes/class-mailtpl.php:88 -msgid "Cheatin’ huh?" -msgstr "Читеришь?" - -#: .././includes/customize-controls/class-send-mail-customize-control.php:13 -msgid "Send" -msgstr "Отправить" - -#: .././includes/customize-controls/class-send-mail-customize-control.php:15 -msgid "Email sent!" -msgstr "Письмо отправлено!" From 851eb26094b8bdee11b7dbd38f9f7d2676929c5d Mon Sep 17 00:00:00 2001 From: Damian Logghe Date: Fri, 16 Jun 2017 17:08:43 -0300 Subject: [PATCH 08/13] sendgrid fix --- includes/class-mailtpl-mailer.php | 14 ++++++++++++++ includes/class-mailtpl.php | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/includes/class-mailtpl-mailer.php b/includes/class-mailtpl-mailer.php index e42a7da..75d7886 100755 --- a/includes/class-mailtpl-mailer.php +++ b/includes/class-mailtpl-mailer.php @@ -87,6 +87,20 @@ public function send_email_generic( $message ) { return $message; } + /** + * Generic Compatibility functions used for Mandrill,Mailgun, etc + * @param $message Array + * + * @return Array + */ + public function send_email_sendgrid( $message ) { + do_action( 'mailtpl/send_email_sendgrid', $message, $this ); + $temp_message = $this->add_template( apply_filters( 'mailtpl/email_content', $message ) ); + $message = $this->replace_placeholders( $temp_message, $message ); + error_log("debug-log:".print_r($message,1)); + return $message; + } + /** * Postman Compatibility * diff --git a/includes/class-mailtpl.php b/includes/class-mailtpl.php index 4979fde..164c8a1 100755 --- a/includes/class-mailtpl.php +++ b/includes/class-mailtpl.php @@ -193,7 +193,7 @@ private function define_hooks() { $this->loader->add_action( 'phpmailer_init', $this->mailer, 'send_email', 50 ); $this->loader->add_filter( 'mandrill_payload', $this->mailer, 'send_email_generic' ); $this->loader->add_filter( 'mg_mutate_message_body', $this->mailer, 'send_email_generic' ); - $this->loader->add_filter( 'sendgrid_mail_html', $this->mailer, 'send_email_generic' ); + $this->loader->add_filter( 'sendgrid_mail_html', $this->mailer, 'send_email_sendgrid' ); $this->loader->add_filter( 'wp_mail', $this->mailer, 'send_email_postman' ); $this->loader->add_action( 'wp_ajax_mailtpl_send_email', $this->mailer, 'send_test_email' ); From 358e2bc9ac91e37169db94a68c888692ff3dd3c2 Mon Sep 17 00:00:00 2001 From: Damian Logghe Date: Thu, 21 Dec 2017 15:45:23 -0300 Subject: [PATCH 09/13] responsive image and alt text for image --- admin/js/mailtpl-public.js | 6 ++++-- admin/templates/partials/header.php | 4 ++-- includes/class-mailtpl-customizer.php | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/admin/js/mailtpl-public.js b/admin/js/mailtpl-public.js index 7263cfc..8005e8f 100755 --- a/admin/js/mailtpl-public.js +++ b/admin/js/mailtpl-public.js @@ -31,8 +31,10 @@ } ); wp.customize( 'mailtpl_opts[header_logo_text]', function( value ) { value.bind( function( newval ) { - if( newval.length ) + if( newval.length && ! $('#logo img').length ) $( '#logo a' ).text( newval ); + if( newval.length && $('#logo img').length ) + $( '#logo img' ).prop('alt', newval ); } ); } ); wp.customize( 'mailtpl_opts[header_aligment]', function( value ) { @@ -49,7 +51,7 @@ } ); wp.customize( 'mailtpl_opts[header_text_size]', function( value ) { value.bind( function( newval ) { - if( newval.length ) + if( newval.length ) $( '#logo' ).css( 'font-size', newval +'px' ); } ); } ); diff --git a/admin/templates/partials/header.php b/admin/templates/partials/header.php index a298b61..07c62e1 100644 --- a/admin/templates/partials/header.php +++ b/admin/templates/partials/header.php @@ -91,9 +91,9 @@

- " href="" title="">'; + echo ''. apply_filters( 'mailtpl/templates/header_logo_alt', !empty($settings['header_logo_text']) ? $settings['header_logo_text'] : get_bloginfo( 'description' ) ) .''; } elseif ( !empty( $settings['header_logo_text'] ) ) { echo $settings['header_logo_text']; } else { diff --git a/includes/class-mailtpl-customizer.php b/includes/class-mailtpl-customizer.php index f49cf32..42c4200 100755 --- a/includes/class-mailtpl-customizer.php +++ b/includes/class-mailtpl-customizer.php @@ -350,7 +350,7 @@ private function header_section( $wp_customize ) { 'type' => 'textarea', 'section' => 'section_mailtpl_header', 'settings' => 'mailtpl_opts[header_logo_text]', - 'description' => __( 'Add text to your mail header', $this->plugin_name ) + 'description' => __( 'Add text to your mail header. Used for alt text when Image it\'s used', $this->plugin_name ) ) ) ); // header alignment From b2b6975e5f6f20272706340abc86f3fde723191a Mon Sep 17 00:00:00 2001 From: Damian Logghe Date: Thu, 21 Dec 2017 15:46:27 -0300 Subject: [PATCH 10/13] shortcode support --- admin/templates/partials/footer.php | 2 +- admin/templates/partials/header.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/admin/templates/partials/footer.php b/admin/templates/partials/footer.php index 724b9c4..80c8435 100644 --- a/admin/templates/partials/footer.php +++ b/admin/templates/partials/footer.php @@ -50,7 +50,7 @@ - + diff --git a/admin/templates/partials/header.php b/admin/templates/partials/header.php index 07c62e1..bf5281f 100644 --- a/admin/templates/partials/header.php +++ b/admin/templates/partials/header.php @@ -91,11 +91,11 @@

- " href="" title="">'; + echo ''. apply_filters( 'mailtpl/templates/header_logo_alt', !empty($settings['header_logo_text']) ? do_shortcode( $settings['header_logo_text'] ) : get_bloginfo( 'description' ) ) .''; } elseif ( !empty( $settings['header_logo_text'] ) ) { - echo $settings['header_logo_text']; + echo do_shortcode($settings['header_logo_text']); } else { echo get_bloginfo('name'); } ?> From db739ff3a34b6ca2bd840f0787f1d823b5fa7ac0 Mon Sep 17 00:00:00 2001 From: Damian Logghe Date: Thu, 21 Dec 2017 15:46:50 -0300 Subject: [PATCH 11/13] compatible plugin list and FAQ for custom templates --- README.txt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/README.txt b/README.txt index d296317..b1c5922 100755 --- a/README.txt +++ b/README.txt @@ -15,7 +15,7 @@ Send beautiful emails with the WordPress Email Templates plugin. Choose your tem Email Template plugin uses Customizer to make it easier. Preview your changes or send a test email with just a few clicks. **Requires WordPress 4.0.0** -Compatible with : [wpMandrill](https://wordpress.org/plugins/wpmandrill/), [Postman SMTP Mailer](https://wordpress.org/support/plugin/postman-smtp), [WP SMTP](https://wordpress.org/plugins/wp-smtp/), [Easy WP SMTP](https://wordpress.org/plugins/easy-wp-smtp/), [Easy SMTP Mail](https://wordpress.org/plugins/webriti-smtp-mail/), [Mailgun](https://wordpress.org/plugins/mailgun/), [Sengrid](https://wordpress.org/plugins/sendgrid-email-delivery-simplified/) +Compatible with : [wpMandrill](https://wordpress.org/plugins/wpmandrill/), [Post SMTP](https://wordpress.org/plugins/post-smtp/), [WP SMTP](https://wordpress.org/plugins/wp-smtp/), [Easy WP SMTP](https://wordpress.org/plugins/easy-wp-smtp/), [Easy SMTP Mail](https://wordpress.org/plugins/webriti-smtp-mail/), [Mailgun](https://wordpress.org/plugins/mailgun/), [Sengrid](https://wordpress.org/plugins/sendgrid-email-delivery-simplified/) = Help with translations = @@ -44,6 +44,16 @@ Thanks to @eliorivero for sharing some customizer tips for plugins :) 2. Activate the plugin through the 'Plugins' menu in WordPress 3. Click on Appearance -> "Email Templates" to start editing +== Frequently Asked Questions == + += How to add a custom template? = + +Copy the templates folder into your theme , then in functions.php add the following: + +`add_filter(‘mailtpl/customizer_template’, function(){ + return get_stylesheet_directory() . “/admin/templates/default.php”; +});` + == Screenshots == 1. Editing a template From 0c5de7ef5d6812cbec764033b6ffdae53148dd03 Mon Sep 17 00:00:00 2001 From: Damian Logghe Date: Thu, 21 Dec 2017 16:29:01 -0300 Subject: [PATCH 12/13] readme update --- README.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.txt b/README.txt index b1c5922..31110d5 100755 --- a/README.txt +++ b/README.txt @@ -3,8 +3,8 @@ Contributors: timersys Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=K4T6L69EV9G2Q Tags: email templates, email template, html email, email template, template, better emails, wp better emails, wp email templates, html emails, wpmandrill, postman, wp smtp, woocommerce, easy digital downloads Requires at least: 4.0 -Tested up to: 4.7.3 -Stable tag: 1.2 +Tested up to: 4.9.1 +Stable tag: 1.2.1 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -62,6 +62,11 @@ Copy the templates folder into your theme , then in functions.php add the follow == Changelog == += 1.2.1 = +* Added shortcode support in header/footer +* Header text now it's used for alt image when using images +* Fixed bug where image was not responsive on mobile devices + = 1.2 = * Added custom css support on template section * Added link color in body section From acafcf0ff72f681667d59781b183be62a56aae2a Mon Sep 17 00:00:00 2001 From: Damian Logghe Date: Thu, 21 Dec 2017 16:29:34 -0300 Subject: [PATCH 13/13] version bump --- mailtpl.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mailtpl.php b/mailtpl.php index 9c85b46..3f476e9 100755 --- a/mailtpl.php +++ b/mailtpl.php @@ -11,7 +11,7 @@ * Plugin Name: Email Templates * Plugin URI: http://wordpress.org/plugins/email-templates * Description: Beautify WordPress default emails - * Version: 1.2 + * Version: 1.2.1 * Author: Damian Logghe * Author URI: https://wp.timersys.com * License: GPL-2.0+ @@ -25,7 +25,7 @@ die; } -define( 'MAILTPL_VERSION' , '1.2'); +define( 'MAILTPL_VERSION' , '1.2.1'); define( 'MAILTPL_PLUGIN_FILE' , __FILE__); define( 'MAILTPL_PLUGIN_DIR' , plugin_dir_path(__FILE__) ); define( 'MAILTPL_PLUGIN_URL' , plugin_dir_url(__FILE__) );