diff --git a/core/um-mail.php b/core/um-mail.php index 6e35c0e6..a1d0a59c 100644 --- a/core/um-mail.php +++ b/core/um-mail.php @@ -36,16 +36,18 @@ class UM_Mail { $lang = icl_get_current_language() . '/'; } } else { + $lang = get_locale(); + $arr_english_lang = array('en_US','en_NZ','en_ZA','en_AU','en_GB'); - if( $lang == 'en_US' ){ + if( in_array( $lang, $arr_english_lang ) ){ $lang = ''; } else { $lang .= '/'; } } - + if ( file_exists( get_stylesheet_directory() . '/ultimate-member/templates/email/' . $lang . $template . '.html' ) ) { $template_path = get_stylesheet_directory() . '/ultimate-member/templates/email/' . $lang . $template . '.html'; } else { @@ -94,7 +96,7 @@ class UM_Mail { // Convert tags in body $this->message = um_convert_tags( $this->message, $args ); - + // Send mail wp_mail( $email, $this->subject, $this->message, $this->headers, $this->attachments ); remove_filter( 'wp_mail_content_type', array(&$this, 'set_content_type') );