public static function email_footer() { global $wp_email_template_fonts_face; $file = 'email_footer.html'; if (file_exists(STYLESHEETPATH . '/emails/' . $file)) { // $footer_template_path = get_stylesheet_directory() . '/emails/'. $file; $footer_template_path = STYLESHEETPATH . '/emails/' . $file; $footer_template_url = get_stylesheet_directory_uri() . '/emails/' . $file; } else { $footer_template_path = WP_EMAIL_TEMPLATE_DIR . '/emails/' . $file; $footer_template_url = WP_EMAIL_TEMPLATE_URL . '/emails/' . $file; } $template_html = file_get_contents($footer_template_path); if ($template_html == false) { $ch = curl_init($footer_template_url); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $template_html = curl_exec($ch); curl_close($ch); } $template_html = WP_Email_Template_Functions::replace_shortcode_footer($template_html); $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;'; $template_html = str_replace('<h1>', '<h1 style="margin:0 0 10px;padding:0;' . $h1_font . '">', $template_html); $template_html = str_replace('<h2>', '<h2 style="margin:0 0 10px;padding:0;' . $h2_font . '">', $template_html); $template_html = str_replace('<h3>', '<h3 style="margin:0 0 10px;padding:0;' . $h3_font . '">', $template_html); $template_html = str_replace('<h4>', '<h4 style="margin:0 0 10px;padding:0;' . $h4_font . '">', $template_html); $template_html = str_replace('<h5>', '<h5 style="margin:0 0 10px;padding:0;' . $h5_font . '">', $template_html); $template_html = str_replace('<h6>', '<h6 style="margin:0 0 10px;padding:0;' . $h6_font . '">', $template_html); $template_html = str_replace('<h1 style=""', '<h1 style="margin:0 0 10px;padding:0;' . $h1_font . '"', $template_html); $template_html = str_replace('<h2 style=""', '<h2 style="margin:0 0 10px;padding:0;' . $h2_font . '"', $template_html); $template_html = str_replace('<h3 style=""', '<h3 style="margin:0 0 10px;padding:0;' . $h3_font . '"', $template_html); $template_html = str_replace('<h4 style=""', '<h4 style="margin:0 0 10px;padding:0;' . $h4_font . '"', $template_html); $template_html = str_replace('<h5 style=""', '<h5 style="margin:0 0 10px;padding:0;' . $h5_font . '"', $template_html); $template_html = str_replace('<h6 style=""', '<h6 style="margin:0 0 10px;padding:0;' . $h6_font . '"', $template_html); $template_html = str_replace("<p>", '<p style="margin:0 0 10px;padding:0;line-height:1.2em">', $template_html); return $template_html; }
function email_footer() { $file = 'email_footer.html'; if (file_exists(STYLESHEETPATH . '/' . $file)) { // $footer_template_path = get_stylesheet_directory() . '/emails/'. $file; $footer_template_path = STYLESHEETPATH . '/emails/' . $file; $footer_template_url = get_stylesheet_directory_uri . '/emails/' . $file; } else { $footer_template_path = WP_EMAIL_TEMPLATE_DIR . '/emails/' . $file; $footer_template_url = get_stylesheet_directory_uri . '/emails/' . $file; } $template_html = file_get_contents($footer_template_path); if ($template_html == false) { $ch = curl_init($footer_template_url); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $template_html = curl_exec($ch); curl_close($ch); } $template_html = WP_Email_Template_Functions::replace_shortcode_footer($template_html); return $template_html; }