Skip to content
This repository has been archived by the owner on Jul 3, 2020. It is now read-only.

Commit

Permalink
Initial Email Construction and Templates
Browse files Browse the repository at this point in the history
  • Loading branch information
bofirial committed Jun 11, 2017
1 parent d244659 commit 977c2d3
Show file tree
Hide file tree
Showing 4 changed files with 174 additions and 163 deletions.
6 changes: 6 additions & 0 deletions Melody49Notifier/EmailShowingTemplate.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<li>
<span class="screen">%Screen%</span>
<span class="movieDescription">%MovieDescription%</span>
<span class="actorDescription">%ActorDescription%</span>
<span class="showingScheduleDescription">%ShowingScheduleDescription%</span>
</li>
300 changes: 141 additions & 159 deletions Melody49Notifier/EmailTemplate.html
Original file line number Diff line number Diff line change
@@ -1,164 +1,146 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!DOCTYPE html>
<html>
<head>
<title>Chakeres Theatres, Inc.</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="description" content="Motion Picture Theatre" />
<meta name="keywords" content="movie info" />
<link rel="stylesheet" type="text/css" href="cti.css" />
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<script language="JavaScript" src="javascript/cti.js" type="text/JavaScript"></script>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Melody 49 Drive-In</title>
<style>
html, body {
height: 100%;
}

body {
background-color: #800000;
background: linear-gradient(to right, #460000 0%,#800000 15%,#800000 85%,#460000 100%);
}

header, footer, .content {
background: white;
text-align: center;
width: 75%;
margin: auto;
font-family: Arial, Helvetica, sans-serif;
padding: 20px 0;
}

header h1, header h2 {
margin: 0;
}

header .theater {
padding-bottom: 10px;
font-family: "Brush Script MT", cursive;
font-size: 64px;
text-shadow: 2px 2px #000;
}

header .theater a {
text-decoration: none;
color: #800000;
}

header .theater a:hover {
color: #af0000;
}

header .scheduleDescription {
color: #444
}

.content {
padding: 0;
}

.showings {
margin: 0;
padding: 5px 0;
list-style-type: none;
background-color: white;
}

.showings li {
padding: 5px 12% 15px;
border: 8px solid black;
border-bottom: none;
margin: 5px 5px 0;
background-color: #ccc;
}

.showings li:nth-child(even) {
background-color: #999;
border-top: none;
margin-top: 0;
border-bottom: 8px solid black;
}

.showings li:nth-child(3) {
margin-top: 20px;
}

.screen {
display: block;
line-height: 24px;
float: left;
padding-bottom: 8px;
}

.movieDescription {
font-weight: bold;
font-size: 24px;
display: block;
padding-bottom: 8px;
}

.actorDescription {

}

.showingScheduleDescription {
float: right;
}

footer {
font-size: 12px;
}

</style>
</head>
<body>
<div id="topmasking" class="center"></div>
<div id="header" class="center">
<div id="banner">
<img src="pics/banner.gif" alt="chakeres theatres banner" />
</div>
<div id="topnav">
<ul>
<li class="first"><a href="index.php">Home</a></li>
<li><a href="employment.php">Employment</a></li>
<li><a href="contact.php">Contact Us</a></li>
<li><a href="https://www.facebook.com/pages/Chakeres-Theatres-Inc/118958294806582/" target="_blank"><img src="pics/find_us_on_facebook.jpg" alt="find us on facebook" width="100" height="30" align="absmiddle" /></a></li>
</ul>
</div>
<div id="theatrenav">
<table width="700" border="0" align="center" cellpadding="0" cellspacing="0">
<tr valign="middle">
<td>
<form name="current" id="current" method="post" action="">
<div align="center">
Find showtimes:
<select name="indoor" onchange="MM_jumpMenu('parent',this,1)">
<option value="selected">Select a location...</option>
<option value=""></option>
<option value="">Indoor Theatres:</option>
<option value="cinema10.php">Cinema 10</option>
<option value="celina.php">Celina Cinema 5</option>
<option value=""></option>
<option value="">Drive-In Theatres:</option>
<option value="melody49di.php">Melody 49 Drive-In</option>
</select>
</div>
</form>
</td>
</tr>
</table>
</div>
<!--<div id="playweek">
<p>**Costume Policy**</br>Masks, hoods, and costumes that cover/hide the face (including makeup that disguises the face) along with costume props such as character related weapons of any kind are prohibited.</p>
</div>-->
<div id="playweek">
<p>Time Schedule for: June 9th - 15th</p>
</div>
<table width="740" border="0" align="center" cellpadding="2" cellspacing="0">
<tr valign="bottom" bgcolor="#600505">
<td><font face="Arial, Helvetica, sans-serif"><strong><font color="#FFFFFF">Melody 49 Drive-In </font></strong></font></td>
<td width="6" bordercolor="#600505" bgcolor="#600505"><font face="Arial, Helvetica, sans-serif">&nbsp;</font></td>
<td width="363" bordercolor="#600505" bgcolor="#600505"><div align="right"><font color="#FFFFFF" size="-1" face="Arial, Helvetica, sans-serif">7606 Pleasant Plain Rd, Brookville, OH 45309</font></div></td>
</tr>
<tr valign="bottom" bgcolor="#600505">
<td>
<font color="#FFFFFF" size="-1" face="Arial, Helvetica, sans-serif">
General Admission:
$8.00
</font>
</td>
<td bordercolor="#600505" bgcolor="#600505">&nbsp;</td>
<td bordercolor="#600505" bgcolor="#600505"><div align="right"><font color="#FFFFFF" size="-1" face="Arial, Helvetica, sans-serif">(937) 833-5015 &amp; 1-888-635-6394</font></div></td>
</tr>
<tr valign="bottom" bgcolor="#600505">
<td><font color="#FFFFFF" size="-1" face="Arial, Helvetica, sans-serif">Children 6 to 11: $2.00</font></td>
<td bordercolor="#600505" bgcolor="#600505">&nbsp;</td>
<td rowspan="2" valign="middle" bordercolor="#600505" bgcolor="#600505"><div align="right"><font color="#FFFFFF" face="Arial, Helvetica, sans-serif"><strong><img src="pics/credit/visa.gif" alt="Visa credit card logo" width="56" height="34" hspace="4" /><img src="pics/credit/mastercard.gif" alt="Mastercard credit card logo" width="56" height="34" hspace="4" /><img src="pics/credit/discover.gif" alt="Discover credit card logo" width="56" height="34" hspace="4" /><img src="pics/credit/american%20express.gif" alt="American Express credit card logo" width="56" height="34" hspace="4" /></strong></font></div></td>
</tr>
<tr valign="bottom" bgcolor="#600505">
<td><font color="#FFFFFF" size="-1" face="Arial, Helvetica, sans-serif">Children 5 &amp; Under: Free</font></td>
<td bordercolor="#600505" bgcolor="#600505">&nbsp;</td>
</tr>
<tr valign="bottom" bgcolor="#600505">
<td bordercolor="#600505" bgcolor="#600505">&nbsp;</td>
<td bordercolor="#600505" bgcolor="#600505"><font face="Arial, Helvetica, sans-serif">&nbsp;</font></td>
<td bordercolor="#600505"><div align="right"><font color="#FFFFFF" size="-1" face="Arial, Helvetica, sans-serif">Now Featuring Digital Projection</font></div></td>
</tr>
</table>
<table width="740" border="0" align="center" cellpadding="2" cellspacing="0">
<tr valign="bottom" bordercolor="#999999" bgcolor="#CCCCCC">
<td width="287"><font size="-1" face="Arial, Helvetica, sans-serif"><strong>Screen 1: </strong></font></td>
<td width="6">&nbsp;</td>
<td width="440">&nbsp;</td>
</tr>
<tr valign="bottom" bordercolor="#999999" bgcolor="#CCCCCC">
<td><font size="-1" face="Arial, Helvetica, sans-serif"><a href="http://www.wonderwomanfilm.com/" target="_blank">Wonder Woman</a> (PG13, 140min)</font></td>
<td>&nbsp;</td>
<td><font size="-1" face="Arial, Helvetica, sans-serif">Gal Gadot</font></td>
</tr>
<tr valign="bottom">
<td><div align="right"><font size="-1" face="Arial, Helvetica, sans-serif">Friday - Thursday</font></div></td>
<td><font size="-1" face="Arial, Helvetica, sans-serif">&nbsp;</font></td>
<td><font color="#333333" size="-1" face="Arial, Helvetica, sans-serif">9:30</font></td>
</tr>
<tr valign="bottom" bordercolor="#999999" bgcolor="#CCCCCC">
<td><font size="-1" face="Arial, Helvetica, sans-serif"><a href="http://www.baywatchfilm.com/" target="_blank">Baywatch</a> (R, 120min)</font></td>
<td>&nbsp;</td>
<td><font size="-1" face="Arial, Helvetica, sans-serif">Dwayne Johnson</font></td>
</tr>
<tr valign="bottom">
<td><div align="right"><font size="-1" face="Arial, Helvetica, sans-serif">Friday - Thursday</font></div></td>
<td><font size="-1" face="Arial, Helvetica, sans-serif">&nbsp;</font></td>
<td><font color="#333333" size="-1" face="Arial, Helvetica, sans-serif">12:00</font></td>
</tr>
<tr valign="bottom">
<td>&nbsp;</td>
<td><font size="-1" face="Arial, Helvetica, sans-serif">&nbsp;</font></td>
<td>&nbsp;</td>
</tr>
<tr valign="bottom" bordercolor="#999999" bgcolor="#CCCCCC">
<td><font size="-1" face="Arial, Helvetica, sans-serif"><strong>Screen 2: </strong></font></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr valign="bottom" bordercolor="#999999" bgcolor="#CCCCCC">
<td><font size="-1" face="Arial, Helvetica, sans-serif"><a href="http://www.themummy.com/" target="_blank">The Mummy</a> (PG13, 120min)</font></td>
<td>&nbsp;</td>
<td><font size="-1" face="Arial, Helvetica, sans-serif">Tom Cruise</font></td>
</tr>
<tr valign="bottom">
<td><div align="right"><font size="-1" face="Arial, Helvetica, sans-serif">Friday - Thursday</font></div></td>
<td><font size="-1" face="Arial, Helvetica, sans-serif">&nbsp;</font></td>
<td><font color="#333333" size="-1" face="Arial, Helvetica, sans-serif">9:30</font></td>
</tr>
<tr valign="bottom" bordercolor="#999999" bgcolor="#CCCCCC">
<td><font size="-1" face="Arial, Helvetica, sans-serif"><a href="https://a24films.com/films/it-comes-at-night" target="_blank">It Comes At Night</a> (R, 100min)</font></td>
<td>&nbsp;</td>
<td><font size="-1" face="Arial, Helvetica, sans-serif">Joel Edgerton</font></td>
</tr>
<tr valign="bottom">
<td><div align="right"><font size="-1" face="Arial, Helvetica, sans-serif">Friday - Thursday</font></div></td>
<td><font size="-1" face="Arial, Helvetica, sans-serif">&nbsp;</font></td>
<td><font color="#333333" size="-1" face="Arial, Helvetica, sans-serif">11:45</font></td>
</tr>
<tr valign="bottom">
<td><div align="right"><font size="-1"><font size="-1"><font face="Arial, Helvetica, sans-serif"><font face="Arial, Helvetica, sans-serif"></font></font></font></font></div></td>
<td><font size="-1" face="Arial, Helvetica, sans-serif">&nbsp;</font></td>
<td><font size="-1" face="Arial, Helvetica, sans-serif">&nbsp;</font></td>
</tr>
</table>
</div>
<div id="footer" class="center">
<div id="slogan" class="center">"Attend The Theatre Regularly - In No Other Way Can You Enjoy Life for So Little"</div>
<div id="copyright" class="center">�2004 - 2017 Chakeres Theatres, Inc.</div>
<div id="signature" class="center">design by <a href="mailto:[email protected]">Mike Wheeler</a></div>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-938528-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>
<header>
<h1 class="theater"><a href="http://www.chakerestheatres.com/melody49di.php">Melody 49 Drive-In</a></h1>
<h2 class="scheduleDescription">%ScheduleDescription%</h2>
</header>

<div class="content">
<ul class="showings">
<!--%Showings%-->
<li>
<span class="screen">Screen 1</span>
<span class="movieDescription">Wonder Woman (PG13, 140min)</span>
<span class="actorDescription">Gal Gadot</span>
<span class="showingScheduleDescription">Friday - Thursday 9:30</span>
</li>
<li>
<span class="screen">%Screen%</span>
<span class="movieDescription">%MovieDescription%</span>
<span class="actorDescription">%ActorDescription%</span>
<span class="showingScheduleDescription">%ShowingScheduleDescription%</span>
</li>
<li>
<span class="screen">%Screen%</span>
<span class="movieDescription">%MovieDescription%</span>
<span class="actorDescription">%ActorDescription%</span>
<span class="showingScheduleDescription">%ShowingScheduleDescription%</span>
</li>
<li>
<span class="screen">%Screen%</span>
<span class="movieDescription">%MovieDescription%</span>
<span class="actorDescription">%ActorDescription%</span>
<span class="showingScheduleDescription">%ShowingScheduleDescription%</span>
</li>
</ul>
</div>

<footer>©2017 Melody 49 Drive-In Notifier</footer>
</body>
</html>
</html>
3 changes: 3 additions & 0 deletions Melody49Notifier/Melody49Notifier.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
<ItemGroup>
<None Update="EmailShowingTemplate.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="host.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand Down
28 changes: 24 additions & 4 deletions Melody49Notifier/Notification/NotificationEmailGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,36 @@ namespace Melody49Notifier.Notification
{
public class NotificationEmailGenerator : INotificationEmailGenerator
{
private readonly TraceWriter log;

public NotificationEmailGenerator(TraceWriter log)
{
Log = log;
this.log = log;
}

public TraceWriter Log { get; }

public string CreateFromTemplate(TheaterSchedule currentTheaterSchedule)
{
return File.ReadAllText("EmailTemplate.html");
string email = File.ReadAllText("EmailTemplate.html");
string showingTemplate = File.ReadAllText("EmailShowingTemplate.html");

string showings = string.Empty;

foreach (TheaterShowing theaterShowing in currentTheaterSchedule.Showings)
{
string showing = string.Copy(showingTemplate);

showing = showing.Replace("%Screen%", theaterShowing.Screen);
showing = showing.Replace("%MovieDescription%", theaterShowing.MovieDescription);
showing = showing.Replace("%ActorDescription%", theaterShowing.ActorDescription);
showing = showing.Replace("%ShowingScheduleDescription%", theaterShowing.ShowingScheduleDescription);

showings += showing;
}

email = email.Replace("%ScheduleDescription%", currentTheaterSchedule.ScheduleDescription);
email = email.Replace("%Showings%", showings);

return email;
}
}
}

0 comments on commit 977c2d3

Please sign in to comment.