Fix email template and localization

This commit is contained in:
champsupertramp
2016-03-03 17:33:15 +08:00
parent 9b993fa941
commit 9861657899
+5 -3
View File
@@ -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') );