- fixes for email templates save process

- fixes for multilanguage email templates;
This commit is contained in:
nikitasinelnikov
2019-04-01 23:44:21 +03:00
parent efa38f7b12
commit b7555b75ab
3 changed files with 61 additions and 7 deletions
+14 -3
View File
@@ -1,9 +1,11 @@
<?php
namespace um\core;
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) exit;
if ( ! class_exists( 'um\core\Mail' ) ) {
@@ -392,8 +394,13 @@ if ( ! class_exists( 'um\core\Mail' ) ) {
*/
function send( $email, $template, $args = array() ) {
if ( ! is_email( $email ) ) return;
if ( UM()->options()->get( $template . '_on' ) != 1 ) return;
if ( ! is_email( $email ) ) {
return;
}
if ( UM()->options()->get( $template . '_on' ) != 1 ) {
return;
}
$this->attachments = null;
$this->headers = 'From: '. UM()->options()->get('mail_from') .' <'. UM()->options()->get('mail_from_addr') .'>' . "\r\n";
@@ -485,7 +492,11 @@ if ( ! class_exists( 'um\core\Mail' ) ) {
) );
// Return what we found.
return ! $template ? false : true;
if ( get_template_directory() === get_stylesheet_directory() ) {
return ! $template ? false : true;
} else {
return strstr( $template, get_stylesheet_directory() );
}
}