2012-08-14 18:05:45 +00:00
< ? php
/**
* Email Header
*
* @ author WooThemes
* @ package WooCommerce / Templates / Emails
2012-12-03 19:19:58 +00:00
* @ version 2.0 . 0
2012-08-14 18:05:45 +00:00
*/
2012-10-15 10:57:58 +00:00
if ( ! defined ( 'ABSPATH' ) ) exit ; // Exit if accessed directly
2012-11-27 16:22:47 +00:00
2012-09-17 10:36:24 +00:00
// Load colours
$bg = get_option ( 'woocommerce_email_background_color' );
$body = get_option ( 'woocommerce_email_body_background_color' );
$base = get_option ( 'woocommerce_email_base_color' );
2013-11-25 13:34:21 +00:00
$base_text = wc_light_or_dark ( $base , '#202020' , '#ffffff' );
2012-09-17 10:36:24 +00:00
$text = get_option ( 'woocommerce_email_text_color' );
2013-11-25 13:34:21 +00:00
$bg_darker_10 = wc_hex_darker ( $bg , 10 );
$base_lighter_20 = wc_hex_lighter ( $base , 20 );
$text_lighter_20 = wc_hex_lighter ( $text , 20 );
2012-09-17 10:36:24 +00:00
2012-11-14 17:44:58 +00:00
// For gmail compatibility, including CSS styles in head/body are stripped out therefore styles need to be inline. These variables contain rules which are added to the template inline. !important; is a gmail hack to prevent styles being stripped if it doesn't like something.
2012-09-17 10:36:24 +00:00
$wrapper = "
2012-11-27 16:22:47 +00:00
background - color : " . esc_attr( $bg ) . " ;
width : 100 % ;
2012-11-14 17:44:58 +00:00
- webkit - text - size - adjust : none ! important ;
margin : 0 ;
2012-09-17 10:36:24 +00:00
padding : 70 px 0 70 px 0 ;
" ;
$template_container = "
2012-11-14 17:44:58 +00:00
box - shadow : 0 0 0 3 px rgba ( 0 , 0 , 0 , 0.025 ) ! important ;
2012-11-27 16:22:47 +00:00
border - radius : 6 px ! important ;
2012-11-14 17:44:58 +00:00
background - color : " . esc_attr( $body ) . " ;
2012-09-17 10:36:24 +00:00
border : 1 px solid $bg_darker_10 ;
2012-11-27 16:22:47 +00:00
border - radius : 6 px ! important ;
2012-09-17 10:36:24 +00:00
" ;
$template_header = "
2012-11-14 17:44:58 +00:00
background - color : " . esc_attr( $base ) . " ;
color : $base_text ;
border - top - left - radius : 6 px ! important ;
border - top - right - radius : 6 px ! important ;
2012-09-17 10:36:24 +00:00
border - bottom : 0 ;
2012-11-27 16:22:47 +00:00
font - family : Arial ;
font - weight : bold ;
line - height : 100 % ;
2012-09-17 10:36:24 +00:00
vertical - align : middle ;
" ;
$body_content = "
2012-11-14 17:44:58 +00:00
background - color : " . esc_attr( $body ) . " ;
border - radius : 6 px ! important ;
2012-09-17 10:36:24 +00:00
" ;
$body_content_inner = "
color : $text_lighter_20 ;
font - family : Arial ;
font - size : 14 px ;
line - height : 150 % ;
text - align : left ;
" ;
$header_content_h1 = "
2012-11-27 16:22:47 +00:00
color : " . esc_attr( $base_text ) . " ;
margin : 0 ;
2012-09-17 10:36:24 +00:00
padding : 28 px 24 px ;
text - shadow : 0 1 px 0 $base_lighter_20 ;
2012-11-27 16:22:47 +00:00
display : block ;
font - family : Arial ;
font - size : 30 px ;
font - weight : bold ;
text - align : left ;
2012-11-14 17:44:58 +00:00
line - height : 150 % ;
2012-09-17 10:36:24 +00:00
" ;
2012-11-14 17:44:58 +00:00
?>
2013-10-15 15:27:57 +00:00
<! DOCTYPE html >
2011-08-16 14:06:08 +00:00
< html >
< head >
< meta http - equiv = " Content-Type " content = " text/html; charset=UTF-8 " />
2014-01-15 05:53:37 +00:00
< title >< ? php echo get_bloginfo ( 'name' ); ?> </title>
2011-08-16 14:06:08 +00:00
</ head >
2012-09-17 10:36:24 +00:00
< body leftmargin = " 0 " marginwidth = " 0 " topmargin = " 0 " marginheight = " 0 " offset = " 0 " >
2012-11-14 17:44:58 +00:00
< div style = " <?php echo $wrapper ; ?> " >
2012-09-17 10:36:24 +00:00
< table border = " 0 " cellpadding = " 0 " cellspacing = " 0 " height = " 100% " width = " 100% " >
2011-08-16 14:06:08 +00:00
< tr >
< td align = " center " valign = " top " >
2014-06-23 13:59:50 +00:00
< div id = " template_header_image " >
< ? php
if ( $img = get_option ( 'woocommerce_email_header_image' ) ) {
echo '<p style="margin-top:0;"><img src="' . esc_url ( $img ) . '" alt="' . get_bloginfo ( 'name' ) . '" /></p>' ;
}
?>
</ div >
2012-09-17 10:36:24 +00:00
< table border = " 0 " cellpadding = " 0 " cellspacing = " 0 " width = " 600 " id = " template_container " style = " <?php echo $template_container ; ?> " >
2011-08-16 14:06:08 +00:00
< tr >
< td align = " center " valign = " top " >
2012-09-17 10:36:24 +00:00
<!-- Header -->
< table border = " 0 " cellpadding = " 0 " cellspacing = " 0 " width = " 600 " id = " template_header " style = " <?php echo $template_header ; ?> " bgcolor = " <?php echo $base ; ?> " >
2011-08-16 14:06:08 +00:00
< tr >
2012-11-14 17:44:58 +00:00
< td >
< h1 style = " <?php echo $header_content_h1 ; ?> " >< ? php echo $email_heading ; ?> </h1>
2012-08-14 18:05:45 +00:00
2011-08-16 14:06:08 +00:00
</ td >
</ tr >
</ table >
2012-09-17 10:36:24 +00:00
<!-- End Header -->
2011-08-16 14:06:08 +00:00
</ td >
</ tr >
< tr >
< td align = " center " valign = " top " >
2012-09-17 10:36:24 +00:00
<!-- Body -->
< table border = " 0 " cellpadding = " 0 " cellspacing = " 0 " width = " 600 " id = " template_body " >
2011-08-16 14:06:08 +00:00
< tr >
2012-11-14 17:44:58 +00:00
< td valign = " top " style = " <?php echo $body_content ; ?> " >
2012-09-17 10:36:24 +00:00
<!-- Content -->
2011-08-16 14:06:08 +00:00
< table border = " 0 " cellpadding = " 20 " cellspacing = " 0 " width = " 100% " >
< tr >
< td valign = " top " >
2014-06-23 13:59:50 +00:00
< div style = " <?php echo $body_content_inner ; ?> " >