From c271590fc9510063a56238e56e482a7d4823ca61 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Mon, 17 Sep 2012 11:36:24 +0100 Subject: [PATCH] Tweak templates --- admin/settings/settings-init.php | 4 +- templates/emails/email-footer.php | 39 +++-- templates/emails/email-header.php | 229 ++++++++++++------------------ 3 files changed, 123 insertions(+), 149 deletions(-) diff --git a/admin/settings/settings-init.php b/admin/settings/settings-init.php index 63c7d2d0245..8187adea9d8 100644 --- a/admin/settings/settings-init.php +++ b/admin/settings/settings-init.php @@ -1106,11 +1106,11 @@ $woocommerce_settings['email'] = apply_filters('woocommerce_email_settings', arr array( 'name' => __( 'Background colour', 'woocommerce' ), - 'desc' => __( 'The background colour for WooCommerce email templates. Default #eeeeee.', 'woocommerce' ), + 'desc' => __( 'The background colour for WooCommerce email templates. Default #f5f5f5.', 'woocommerce' ), 'id' => 'woocommerce_email_background_color', 'type' => 'color', 'css' => 'width:6em;', - 'std' => '#eeeeee' + 'std' => '#f5f5f5' ), array( diff --git a/templates/emails/email-footer.php b/templates/emails/email-footer.php index 0cf5f935fc6..f9167efca86 100644 --- a/templates/emails/email-footer.php +++ b/templates/emails/email-footer.php @@ -4,43 +4,60 @@ * * @author WooThemes * @package WooCommerce/Templates/Emails - * @version 1.6.4 + * @version 1.7.0 */ +// Load colours +$base = get_option( 'woocommerce_email_base_color' ); + +$base_lighter_40 = woocommerce_hex_lighter( $base, 40 ); + +// 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. +$template_footer = " + border-top:0; + -webkit-border-radius:6px; +"; + +$credit = " + border:0; + color: $base_lighter_40; + font-family: Arial; + font-size:12px; + line-height:125%; + text-align:center; +"; ?> - + - + - - + +
- - + -
diff --git a/templates/emails/email-header.php b/templates/emails/email-header.php index 687f27d9510..aecaca24ae0 100644 --- a/templates/emails/email-header.php +++ b/templates/emails/email-header.php @@ -4,44 +4,82 @@ * * @author WooThemes * @package WooCommerce/Templates/Emails - * @version 1.6.4 + * @version 1.7.0 */ + +// Load colours +$bg = get_option( 'woocommerce_email_background_color' ); +$body = get_option( 'woocommerce_email_body_background_color' ); +$base = get_option( 'woocommerce_email_base_color' ); +$base_text = woocommerce_light_or_dark( $base, '#202020', '#ffffff' ); +$text = get_option( 'woocommerce_email_text_color' ); +$bg_darker_10 = woocommerce_hex_darker( $bg, 10 ); +$base_lighter_20 = woocommerce_hex_lighter( $base, 20 ); +$text_lighter_20 = woocommerce_hex_lighter( $text, 20 ); +$text_lighter_40 = woocommerce_hex_lighter( $text, 40 ); +$text_darker_50 = woocommerce_hex_darker( $text, 50 ); + +// 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. +$wrapper = " + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAADgkQYQAAAANklEQVQYV2NkIAIwEqFGkpAiSaAhzwkpAluESxHYBJhTsClCUYDPJBT/IJuEYQK6dTgVgBQCAG5EBSOuEsbJAAAAAElFTkSuQmCC); + background-repeat: repeat-y no-repeat; + background-position: top center; + background-color: $bg; + width:100% !important; + -webkit-text-size-adjust:none; + margin:0; + padding: 70px 0 70px 0; +"; +$template_container = " + -webkit-box-shadow:0 0 0 3px rgba(0,0,0,0.025); + -webkit-border-radius:6px; + background-color: $body; + border: 1px solid $bg_darker_10; + -webkit-border-radius:6px; +"; +$template_header = " + background-color: $base; + color: $base_text; + -webkit-border-top-left-radius:6px; + -webkit-border-top-right-radius:6px; + border-bottom: 0; + font-family:Arial; + font-weight:bold; + line-height:100%; + vertical-align:middle; +"; +$body_content = " + background-color: $body; + -webkit-border-radius:6px; +"; +$body_content_inner = " + color: $text_lighter_20; + font-family:Arial; + font-size:14px; + line-height:150%; + text-align:left; +"; +$header_content_h1 = " + color: $base_text !important; + margin:0; + padding: 28px 24px; + text-shadow: 0 1px 0 $base_lighter_20; +"; + ?> - <?php echo get_bloginfo('name'); ?> - -
- + +
+
- '.get_bloginfo('name').'

'; - endif; + if ( $img = get_option( 'woocommerce_email_header_image' ) ) { + echo '

' . get_bloginfo( 'name' ) . '

'; + } ?> - - - +
- - - + +
-
- - -

- +
+

+
- +
- - + +
-
- - + +
-
\ No newline at end of file +
\ No newline at end of file