public static function woo_email_footer_marker_end() { global $wp_email_template_general; if (self::check_apply_template_for_woocommerce_emails()) { echo '<!--WOO_EMAIL_TEMPLATE_FOOTER_END-->'; ob_get_clean(); echo WP_Email_Template_Functions::email_footer(); } echo '<!--NO_USE_EMAIL_TEMPLATE-->'; }
function woo_email_footer_marker_end() { $wp_email_template_settings = get_option('wp_email_template_settings'); if (!is_array($wp_email_template_settings)) { $wp_email_template_settings = array(); } $wp_email_template_default_settings = WP_Email_Template_Settings::get_settings_default(); $wp_email_template_settings = array_merge($wp_email_template_default_settings, $wp_email_template_settings); if (isset($wp_email_template_settings['apply_for_woo_emails']) && trim(esc_attr($wp_email_template_settings['apply_for_woo_emails'])) == 'yes') { echo '<!--WOO_EMAIL_TEMPLATE_FOOTER_END-->'; ob_get_clean(); echo '<!--NO_USE_EMAIL_TEMPLATE-->'; echo WP_Email_Template_Functions::email_footer(); } }
public static function email_content($email_heading = '', $message = '', $preview_mode = false) { global $wp_email_template_fonts_face; global $wp_email_template_general; $html = ''; // Don't remove email template when it's preview mode if (!$preview_mode) { // Don't apply WP Email Template if disable this feature if ($wp_email_template_general['apply_template_all_emails'] != 'yes') { return $message; } } if (stristr($message, '<!--NO_USE_EMAIL_TEMPLATE-->') === false) { $html .= WP_Email_Template_Functions::email_header($email_heading); } $html .= wpautop(make_clickable($message)); if (stristr($message, '<!--NO_USE_EMAIL_TEMPLATE-->') === false) { $html .= WP_Email_Template_Functions::email_footer(); $html .= '<!--NO_USE_EMAIL_TEMPLATE-->'; } $h1_font = 'font:italic 26px Century Gothic, sans-serif !important; color: #000000 !important;'; $h2_font = 'font:italic 20px Century Gothic, sans-serif !important; color: #000000 !important;'; $h3_font = 'font:italic 18px Century Gothic, sans-serif !important; color: #000000 !important;'; $h4_font = 'font:italic 16px Century Gothic, sans-serif !important; color: #000000 !important;'; $h5_font = 'font:italic 14px Century Gothic, sans-serif !important; color: #000000 !important;'; $h6_font = 'font:italic 12px Century Gothic, sans-serif !important; color: #000000 !important;'; $html = str_replace('<h1>', '<h1 style="margin:0 0 10px;padding:0;' . $h1_font . '">', $html); $html = str_replace('<h2>', '<h2 style="margin:0 0 10px;padding:0;' . $h2_font . '">', $html); $html = str_replace('<h3>', '<h3 style="margin:0 0 10px;padding:0;' . $h3_font . '">', $html); $html = str_replace('<h4>', '<h4 style="margin:0 0 10px;padding:0;' . $h4_font . '">', $html); $html = str_replace('<h5>', '<h5 style="margin:0 0 10px;padding:0;' . $h5_font . '">', $html); $html = str_replace('<h6>', '<h6 style="margin:0 0 10px;padding:0;' . $h6_font . '">', $html); $html = str_replace('<h1 style=""', '<h1 style="margin:0 0 10px;padding:0;' . $h1_font . '"', $html); $html = str_replace('<h2 style=""', '<h2 style="margin:0 0 10px;padding:0;' . $h2_font . '"', $html); $html = str_replace('<h3 style=""', '<h3 style="margin:0 0 10px;padding:0;' . $h3_font . '"', $html); $html = str_replace('<h4 style=""', '<h4 style="margin:0 0 10px;padding:0;' . $h4_font . '"', $html); $html = str_replace('<h5 style=""', '<h5 style="margin:0 0 10px;padding:0;' . $h5_font . '"', $html); $html = str_replace('<h6 style=""', '<h6 style="margin:0 0 10px;padding:0;' . $h6_font . '"', $html); $html = str_replace("<p>", '<p style="margin:0 0 10px;padding:0;line-height:1.2em">', $html); return $html; }
function email_content($email_heading = '', $message = '') { $html = ''; if (stristr($message, '<!--NO_USE_EMAIL_TEMPLATE-->') === false) { $html .= WP_Email_Template_Functions::email_header($email_heading); } $html .= wpautop(make_clickable($message)); if (stristr($message, '<!--NO_USE_EMAIL_TEMPLATE-->') === false) { $html .= WP_Email_Template_Functions::email_footer(); } return $html; }
public static function email_content($email_heading='', $message='', $preview_mode=false) { global $wp_email_template_fonts_face, $wp_email_template_style_body; global $wp_email_template_general, $wp_email_template_exclude_emails; $html = ''; // Don't remove email template when it's preview mode if ( ! $preview_mode ) { // Don't apply WP Email Template for email content has exclude shortcodes $exclude_shortcode = trim( $wp_email_template_exclude_emails['exclude_shortcode'] ); if ( '' == $exclude_shortcode ) $exclude_shortcode = '[not_apply_email_template]'; if ( stristr( $message, $exclude_shortcode ) !== false ) { $message = str_replace( $exclude_shortcode, '', $message ); $message = str_replace( '[not_apply_email_template]', '', $message ); if ( $wp_email_template_general['apply_template_all_emails'] == 'yes' ) { if ( strip_tags( $message ) == $message ) { $message = nl2br( $message ); } } return $message; } // Don't apply WP Email Template if disable this feature if ( $wp_email_template_general['apply_template_all_emails'] != 'yes' ) { return $message; } } if (stristr($message, '<!--NO_USE_EMAIL_TEMPLATE-->') === false ) $html .= WP_Email_Template_Functions::email_header($email_heading); $html .= wpautop( make_clickable( $message) ); if (stristr($message, '<!--NO_USE_EMAIL_TEMPLATE-->') === false ) { $html .= WP_Email_Template_Functions::email_footer(); $html .= '<!--NO_USE_EMAIL_TEMPLATE-->'; } $h1_font = $wp_email_template_fonts_face->generate_font_css( $wp_email_template_style_body['h1_font'] ); $h2_font = $wp_email_template_fonts_face->generate_font_css( $wp_email_template_style_body['h2_font'] ); $h3_font = $wp_email_template_fonts_face->generate_font_css( $wp_email_template_style_body['h3_font'] ); $h4_font = $wp_email_template_fonts_face->generate_font_css( $wp_email_template_style_body['h4_font'] ); $h5_font = $wp_email_template_fonts_face->generate_font_css( $wp_email_template_style_body['h5_font'] ); $h6_font = $wp_email_template_fonts_face->generate_font_css( $wp_email_template_style_body['h6_font'] ); $html = str_replace('<h1>', '<h1 style="margin:0 0 10px;padding:0;'.$h1_font.'">', $html); $html = str_replace('<h2>', '<h2 style="margin:0 0 10px;padding:0;'.$h2_font.'">', $html); $html = str_replace('<h3>', '<h3 style="margin:0 0 10px;padding:0;'.$h3_font.'">', $html); $html = str_replace('<h4>', '<h4 style="margin:0 0 10px;padding:0;'.$h4_font.'">', $html); $html = str_replace('<h5>', '<h5 style="margin:0 0 10px;padding:0;'.$h5_font.'">', $html); $html = str_replace('<h6>', '<h6 style="margin:0 0 10px;padding:0;'.$h6_font.'">', $html); $html = str_replace('<h1 style=""', '<h1 style="margin:0 0 10px;padding:0;'.$h1_font.'"', $html); $html = str_replace('<h2 style=""', '<h2 style="margin:0 0 10px;padding:0;'.$h2_font.'"', $html); $html = str_replace('<h3 style=""', '<h3 style="margin:0 0 10px;padding:0;'.$h3_font.'"', $html); $html = str_replace('<h4 style=""', '<h4 style="margin:0 0 10px;padding:0;'.$h4_font.'"', $html); $html = str_replace('<h5 style=""', '<h5 style="margin:0 0 10px;padding:0;'.$h5_font.'"', $html); $html = str_replace('<h6 style=""', '<h6 style="margin:0 0 10px;padding:0;'.$h6_font.'"', $html); $html = str_replace("<p>", '<p style="margin:0 0 10px;padding:0;line-height:1.2em">', $html); return $html; }