Skip to content

Commit

Permalink
Merge pull request #22 from upsellpl/feature/new-emails-design
Browse files Browse the repository at this point in the history
Feature/new emails design
  • Loading branch information
upsellpl authored Dec 28, 2021
2 parents 8055929 + fd9907a commit c674e64
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 72 deletions.
27 changes: 15 additions & 12 deletions templates/emails/footer-default.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
line-height:125%;
text-align:center;
";

$credit_link = '
text-decoration: none;
color: #6D6D6D;
';
?>
</div>
</td>
Expand All @@ -36,26 +41,24 @@
<!-- End Body -->
</td>
</tr>
</table>

<!-- Footer -->
<table border='0' cellpadding='10' cellspacing='0' width='600' id='template_footer'
style="<?php echo $template_footer; ?>">
<tr>
<td align="center" valign="top">
<!-- Footer -->
<table border="0" cellpadding="10" cellspacing="0" width="600" id="template_footer" style="<?php echo $template_footer; ?>">
<td valign='top'>
<table border='0' cellpadding='10' cellspacing='0' width='100%'>
<tr>
<td valign="top">
<table border="0" cellpadding="10" cellspacing="0" width="100%">
<tr>
<td colspan="2" valign="middle" id="credit" style="<?php echo $credit; ?>">
<?php echo wpautop( wp_kses_post( wptexturize( apply_filters( 'edd_email_footer_text', '<a href="' . esc_url( home_url() ) . '">' . get_bloginfo( 'name' ) . '</a>' ) ) ) ); ?>
</td>
</tr>
</table>
<td colspan='2' valign='middle' id='credit' style="<?php echo $credit; ?>">
<?php echo wpautop(wp_kses_post(wptexturize(apply_filters('edd_email_footer_text', '<a href="' . esc_url(home_url()) . '" style="' . $credit_link . '">' . get_bloginfo('name') . '</a>')))); ?>
</td>
</tr>
</table>
<!-- End Footer -->
</td>
</tr>
</table>
<!-- End Footer -->
</td>
</tr>
</table>
Expand Down
132 changes: 72 additions & 60 deletions templates/emails/header-default.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,33 @@
/**
* Email Header
*
* @author Easy Digital Downloads
* @package Easy Digital Downloads/Templates/Emails
* @author Easy Digital Downloads
* @package Easy Digital Downloads/Templates/Emails
* @version 2.1
*/

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
if (!defined('ABSPATH')) exit; // Exit if accessed directly

// 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.
$body = "
background-color: #f6f6f6;
font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;
";
$wrapper = "
$wrapper = '
width:100%;
-webkit-text-size-adjust:none !important;
margin:0;
padding: 70px 0 70px 0;
";
$template_container = "
padding: 40px 0 40px 0;
';
$template_container = '
box-shadow:0 0 0 1px #f3f3f3 !important;
border-radius:3px !important;
background-color: #ffffff;
border: 1px solid #e9e9e9;
border-radius:3px !important;
padding: 20px;
";
$template_header = "
border-radius:10px !important;
padding: 20px 20px 60px;
margin: 0 15px;
';
$template_header = '
color: #00000;
border-top-left-radius:3px !important;
border-top-right-radius:3px !important;
Expand All @@ -37,71 +37,83 @@
line-height:100%;
text-align: center;
vertical-align:middle;
";
';
$body_content = "
border-radius:3px !important;
font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;
";
$body_content_inner = "
color: #000000;
color: #333333;
font-size:14px;
font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;
line-height:150%;
text-align:left;
padding: 20px 0;
";
$header_content_h1 = "
color: #000000;
color: #333333;
margin:0;
padding: 28px 24px;
padding: 40px 24px;
border-bottom: 1px solid #F2F2F2;
display:block;
font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;
font-size:32px;
font-weight: 500;
font-weight: 600;
line-height: 1.2;
";
$header_img = edd_get_option( 'email_logo', '' );
$heading = EDD()->emails->get_heading();

$logo_img = '
max-width: 100px;
max-height: 100px;
height: auto;
margin-bottom: 40px;
display: block;
';
$logo_img_src = apply_filters('email_logo_url', null);

$heading = EDD()->emails->get_heading();
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><?php echo get_bloginfo( 'name' ); ?></title>
</head>
<body leftmargin="0" marginwidth="0" topmargin="0" marginheight="0" offset="0" style="<?php echo $body; ?>">
<div style="<?php echo $wrapper; ?>">
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
<tr>
<td align="center" valign="top">
<?php if( ! empty( $header_img ) ) : ?>
<div id="template_header_image">
<?php echo '<p style="margin-top:0;"><img src="' . esc_url( $header_img ) . '" alt="' . get_bloginfo( 'name' ) . '" /></p>'; ?>
</div>
<?php endif; ?>
<table border="0" cellpadding="0" cellspacing="0" width="520" id="template_container" style="<?php echo $template_container; ?>">
<?php if ( ! empty ( $heading ) ) : ?>
<tr>
<td align="center" valign="top">
<!-- Header -->
<table border="0" cellpadding="0" cellspacing="0" width="520" id="template_header" style="<?php echo $template_header; ?>" bgcolor="#ffffff">
<tr>
<td>
<h1 style="<?php echo $header_content_h1; ?>"><?php echo $heading; ?></h1>
</td>
</tr>
</table>
<!-- End Header -->
</td>
</tr>
<?php endif; ?>
<tr>
<td align="center" valign="top">
<!-- Body -->
<table border="0" cellpadding="0" cellspacing="0" width="520" id="template_body">
<tr>
<td valign="top" style="<?php echo $body_content; ?>">
<!-- Content -->
<table border="0" cellpadding="20" cellspacing="0" width="100%">
<tr>
<td valign="top">
<div style="<?php echo $body_content_inner; ?>">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title><?php echo get_bloginfo('name'); ?></title>
</head>
<body leftmargin="0" marginwidth="0" topmargin="0" marginheight="0" offset="0" style="<?php echo $body; ?>">
<div style="<?php echo $wrapper; ?>">
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
<tr>
<td align="center" valign="top">
<?php if (!is_null($logo_img_src)): ?>
<img src="<?= $logo_img_src ?>" alt="" style="<?= $logo_img ?>">
<?php endif; ?>

<table border="0" cellpadding="0" cellspacing="0" width="600" id="template_container"
style="<?php echo $template_container; ?>">
<?php if (!empty ($heading)) : ?>
<tr>
<td align="center" valign="top">
<!-- Header -->
<table border="0" cellpadding="0" cellspacing="0" width="480" id="template_header"
style="<?php echo $template_header; ?>" bgcolor="#ffffff">
<tr>
<td>
<h1 style="<?php echo $header_content_h1; ?>"><?php echo $heading; ?></h1>
</td>
</tr>
</table>
<!-- End Header -->
</td>
</tr>
<?php endif; ?>
<tr>
<td align="center" valign="top">
<!-- Body -->
<table border="0" cellpadding="0" cellspacing="0" width="480" id="template_body">
<tr>
<td valign="top" style="<?php echo $body_content; ?>">
<!-- Content -->
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td valign="top">
<div style="<?php echo $body_content_inner; ?>">

0 comments on commit c674e64

Please sign in to comment.