Skip to content

Commit

Permalink
Added a whole bunch of emails
Browse files Browse the repository at this point in the history
  • Loading branch information
fditrapani committed Sep 9, 2020
1 parent 3f707ab commit 43f0326
Show file tree
Hide file tree
Showing 18 changed files with 918 additions and 21 deletions.
Binary file modified .DS_Store
Binary file not shown.
78 changes: 78 additions & 0 deletions cancelled-plan.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<html xmlns:v="urn:schemas-microsoft-com:vml">
<?php include("components.php") ?>
<?php include("styles.php") ?>
<?php include("colors.php"); ?>

<head>
<title>WordPress.com</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Language" content="en-us">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="format-detection" content="date=no">
<meta name="format-detection" content="telephone=no">
<meta name="format-detection" content="address=no">


</head>
<body bgcolor="<?php echo $color['background']; ?>" style="direction: ltr; background-color: <?php echo $color['background']; ?>; margin: 0; padding: 0;">
<?php echo renderStyles() ?>

<?php
$product = renderItem(
"WordPress.com Personal",
$color["error"],
"Expires August 22, 2020",
"Plan for " . renderTextLink("Filippo Di Trapani"),
);
$button_cta = renderRegularText("Add another year for $60", $color["white"], "14px");
$button = renderPrimaryButton( $button_cta );

$verticalSpacer = renderVerticalSpacer( "40px" );
$halfVerticalSpacer = renderVerticalSpacer( "20px" );
$featureTitle = renderSecondaryTitle( "Don’t lose out" );
$featureParagraph = "<p style='margin-top: 0'>" . renderRegularText("Your plan will continue to run until it expires. If you choose not to renew, these features will be removed from your site.") . "</p>";
$featureList = renderUnorderedList( array(
1 => renderRegularText("Ability to set filippodt.com as your primary address."),
2 => renderRegularText("Remove WordPress.com ads from your site."),
3 => renderRegularText("Access to live chat when you need immediate support."),
4 => renderRegularText("Increased storage space for your photos, audio files, or videos."),
), "warning");

$billingContent = renderBillingHistory();

$recentPurchaseTitle = renderBoldText("Recently renewed");
$horizontalRule = renderHorizontalRule();
$recentPurchaseDetails = renderItem(
"filippodt.com",
$color['success'],
"Renewed for $20 on July 22, 2020",
".com domain registration" );

$supportContent = renderSupport();

$content = <<<EOD
$product
$halfVerticalSpacer
$button
$verticalSpacer
$featureTitle
$featureParagraph
$featureList
$verticalSpacer
$billingContent
$recentPurchaseTitle
$horizontalRule
$halfVerticalSpacer
$recentPurchaseDetails
$halfVerticalSpacer
$supportContent
EOD;

echo renderEmailTemplate( "You cancelled your plan", $content );
?>
</body>
</html>
90 changes: 90 additions & 0 deletions cancelled-subscriptions.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<html xmlns:v="urn:schemas-microsoft-com:vml">
<?php include("components.php") ?>
<?php include("styles.php") ?>
<?php include("colors.php"); ?>

<head>
<title>WordPress.com</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Language" content="en-us">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="format-detection" content="date=no">
<meta name="format-detection" content="telephone=no">
<meta name="format-detection" content="address=no">


</head>
<body bgcolor="<?php echo $color['background']; ?>" style="direction: ltr; background-color: <?php echo $color['background']; ?>; margin: 0; padding: 0;">
<?php echo renderStyles() ?>

<?php
$horizontalRule = renderHorizontalRule();
$verticalSpacer = renderVerticalSpacer( "40px" );
$halfVerticalSpacer = renderVerticalSpacer( "20px" );

$product = renderItem(
"WordPress.com Personal",
$color["error"],
"Expires August 22, 2020",
"Plan for " . renderTextLink("Filippo Di Trapani")
);

$secondary_button_cta = renderRegularText("Reactivate subscription", $color["text"], "14px");
$secondary_button = renderSecondaryButton( $secondary_button_cta );

$domain = renderItem(
"filippodt.com",
$color["error"],
"Expires August 28, 2020",
"Primary domain for " . renderTextLink("Filippo Di Trapani")
);
$domain_button = renderSecondaryButton( $secondary_button_cta );

$button_cta = renderRegularText("Reactivate these subscriptions", $color["white"], "14px");
$button = renderPrimaryButton( $button_cta );

$featureTitle = renderSecondaryTitle( "Don’t lose out" );
$featureParagraph = "<p style='margin-top: 0'>" . renderRegularText("Your upgrades will continue to run until they expires. If you choose not to renew, these features will be removed from your site.") . "</p>";
$featureList = renderUnorderedList( array(
1 => renderRegularText("Ability to set filippodt.com as your primary address."),
2 => renderRegularText("Remove WordPress.com ads from your site."),
3 => renderRegularText("Access to live chat when you need immediate support."),
4 => renderRegularText("Increased storage space for your photos, audio files, or videos."),
), "warning");

$billingContent = renderBillingHistory();

$supportContent = renderSupport();

$content = <<<EOD
$horizontalRule
$halfVerticalSpacer
$product
<p style="margin-bottom: 0">$secondary_button</p>
$halfVerticalSpacer
$horizontalRule
$halfVerticalSpacer
$domain
<p style="margin-bottom: 0">$domain_button</p>
$halfVerticalSpacer
$horizontalRule
$halfVerticalSpacer
$button
$verticalSpacer
$featureTitle
$featureParagraph
$featureList
$verticalSpacer
$billingContent
$supportContent
EOD;

echo renderEmailTemplate( "You cancelled your subscription", $content );
?>
</body>
</html>
4 changes: 3 additions & 1 deletion colors.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
'white' => "#FFFFFF",
'background' => "#F3F6F8",
'text' => '#353535',
'lightText' => '#646970',
'success' => '#007E65',
'error' => '#FF001F',
'error' => '#D63638',
'warning' => '#B26200',
'link' => '#1282D6',
'border' => '#DCDCDE'
);
Expand Down
54 changes: 42 additions & 12 deletions components.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ function renderEmailTitle( $title ) {
$emailTitle = <<<EOD
<!-- emailTitle start -->
<h1 style="margin-top:0; margin-bottom: 36px;">
<font face="Helvetica, Arial, sans-serif" size="5" style="font-size:28px; line-height: 1.2em;">
<font face="Helvetica, Arial, sans-serif" size="5" style="font-size:28px; line-height: 1.2em; font-weight: 400">
$title
</font>
</h1>
Expand Down Expand Up @@ -163,11 +163,16 @@ function renderUnorderedList( $list, $icon ) {
return $unorderedList;
}

function renderItem( $itemTitle, $itemStatus, $itenStatusMessage, $itemDescription) {
function renderItem( $itemTitle, $itemStatus, $itenStatusMessage, $itemDescription, $showSubscription = true, $showStatusInColumn = false) {
$title = renderBoldText( $itemTitle );
$manageSubscriptionButton = renderTextButton("Settings");
$status = renderBoldText( $itenStatusMessage, $itemStatus );
$manageSubscriptionButton = $showSubscription ? renderTextButton("Settings") : "" ;
$status = renderRegularText( $itenStatusMessage, $itemStatus );

$sideBarStatus = $showStatusInColumn ? $status : null;
$bottomStatus = !$showStatusInColumn ? "<tr><td colspan='2'>$status</td></tr>" : null;

$description = renderRegularText( $itemDescription );
$descriptionPadding = $showStatusInColumn ? "0" : "8px";

$item = <<<EOD
<!-- emailTemplate start -->
Expand All @@ -178,18 +183,15 @@ function renderItem( $itemTitle, $itemStatus, $itenStatusMessage, $itemDescripti
</td>
<td align="right">
$manageSubscriptionButton
$sideBarStatus
</td>
</tr>
<tr>
<td colspan="2" style="padding-bottom: 8px;">
<td colspan="2" style="padding-bottom: $descriptionPadding;">
$description
</td>
</tr>
<tr>
<td colspan="2">
$status
</td>
</tr>
$bottomStatus
</table>
<!-- emailTemplate end -->
EOD;
Expand All @@ -213,6 +215,22 @@ function renderPrimaryButton( $buttonCta ) {
return $button;
}

function renderSecondaryButton( $buttonCta ) {
$color = include("colors.php");

$button = <<<EOD
<table cellpadding="0" cellspacing="0">
<tr>
<td class="primary-button" bgcolor="$color[white]" style="border-radius: 3px; border: 1px solid $color[text]">
<a href="#" style="border-top: 10px solid $color[white]; border-bottom: 10px solid $color[white]; border-left: 40px solid $color[white]; border-right: 40px solid $color[white]; display:inline-block; text-decoration: none; border-radius: 3px; color: $color[text]; text-align: center;">$buttonCta</a>
</td>
</tr>
</table>
EOD;

return $button;
}

function renderTextButton( $text, $textColor = "#1282D6" ){
$color = include("colors.php");

Expand All @@ -223,6 +241,18 @@ function renderTextButton( $text, $textColor = "#1282D6" ){
return $textButton;
}

function renderTextLink( $text, $textColor = '#353535', $size = "16px" ){
$color = include("colors.php");
$text = renderRegularText( $text, $textColor, $size );
$textLink = <<<EOD
<a href='#' class='text-link' style='color: $textColor'>
$text
</a>
EOD;

return $textLink;
}

function renderHorizontalRule() {
$color = include("colors.php");

Expand Down Expand Up @@ -295,8 +325,8 @@ function renderFooter() {
"<div align='right'><a href='#'><img src='images/app-store.png' width='140px' border='0'/></a></div>",
"<a href='#'><img src='images/play-store.png' width='140px' border='0'/></a>" );

$automatticDetails = "<a href='https://automattic.com' class='text-link' style='color: $color[link]'>" . renderRegularText( "Automattic, Inc.", "#1282D6" ) . "</a><br/>" .
renderRegularText( "60 29th St. #343, San Francisco, CA 94110 ", $color['link'], "14px" );
$automatticDetails = "<a href='https://automattic.com' class='text-link' style='color: $color[text]'>" . renderRegularText( "Automattic, Inc.", $color["text"] ) . "</a><br/>" .
renderRegularText( "60 29th St. #343, San Francisco, CA 94110 ", $color['text'], "14px" );

$loveNote = renderRegularText( "Sent with <font color='$color[link]'>&hearts;</font> from your friends at WordPress.com", );

Expand Down
2 changes: 1 addition & 1 deletion expired.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
$product = renderItem(
"WordPress.com Personal",
$color["error"],
"Expired Jul 2, 2020",
"Expired July 2, 2020",
"Plan for <a href='#' class='text-link' style='color:" . $color["text"] . "'>" . renderRegularText("Filippo Di Trapani") . "</a>",
);
$button_cta = renderRegularText("Add another month for $3", $color["white"], "14px");
Expand Down
87 changes: 87 additions & 0 deletions expiring-card.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<html xmlns:v="urn:schemas-microsoft-com:vml">
<?php include("components.php") ?>
<?php include("styles.php") ?>
<?php include("colors.php"); ?>

<head>
<title>WordPress.com</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Language" content="en-us">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="format-detection" content="date=no">
<meta name="format-detection" content="telephone=no">
<meta name="format-detection" content="address=no">


</head>
<body bgcolor="<?php echo $color['background']; ?>" style="direction: ltr; background-color: <?php echo $color['background']; ?>; margin: 0; padding: 0;">
<?php echo renderStyles() ?>

<?php
$horizontalRule = renderHorizontalRule();
$verticalSpacer = renderVerticalSpacer( "40px" );
$halfVerticalSpacer = renderVerticalSpacer( "20px" );

$card = renderItem(
"VISA ending in 4020",
$color["error"],
"Expires September 30, 2020",
"Filippo Di Trapani",
false,
);

$button_cta = renderRegularText("Change payment method", $color["white"], "14px");
$button = renderPrimaryButton( $button_cta );

$featureTitle = renderSecondaryTitle( "Don’t lose out" );
$featureParagraph = "<p style='margin-top: 0'>" . renderRegularText("Please note that if we can’t process your payment, your upgrades will be removed from your site.") . "</p>";
$product = renderItem(
"WordPress.com Personal",
$color["warning"],
"Expires August 22, 2020",
"Plan for <a href='#' class='text-link' style='color:" . $color["text"] . "'>" . renderRegularText("Filippo Di Trapani") . "</a>",
);
$domain = renderItem(
"filippodt.com",
$color["warning"],
"Expires August 28, 2020",
"Primary domain for <a href='#' class='text-link' style='color:" . $color["text"] . "'>" . renderRegularText("Filippo Di Trapani") . "</a>",
);


$billingContent = renderBillingHistory();

$supportContent = renderSupport();

$content = <<<EOD
$horizontalRule
$halfVerticalSpacer
$card
$halfVerticalSpacer
$horizontalRule
$halfVerticalSpacer
$button
$verticalSpacer
$featureTitle
$featureParagraph
$horizontalRule
$halfVerticalSpacer
$product
$halfVerticalSpacer
$horizontalRule
$halfVerticalSpacer
$domain
$halfVerticalSpacer
$horizontalRule
$verticalSpacer
$billingContent
$supportContent
EOD;

echo renderEmailTemplate( "Your credit card is about to expire", $content );
?>
</body>
</html>
Loading

0 comments on commit 43f0326

Please sign in to comment.