﻿<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
  <xsl:output method="html" indent="yes"/>

  <xsl:template match="/">
    <html>
      <body style="background: #f0f0f0; text-align: center;">
        <style type="text/css">
          h1, h2, h3, h4, h5, h6 { font-weight: normal; margin: 0; }
          h1 { font-size: 1.8em; }
          h2 { font-size: 1.6em; }
          h3 { font-size: 1.3em; }
          h4, h5 h6 { font-size: 1.1em; font-weight: bold; }
          a { color: #0000cc; }
          hr { height: 2px; border-style: none; background: #ddd; color: #ddd; margin: 1em 0; }
          div.message hr { margin: 5px 0; color: #000; background: #000; }
          div.footerLinks a { color: #0000cc; }
        </style>
        <table width="500" cellpadding="10" cellspacing="0" class="emailLayout" style="background: #fff; text-align: left; color: #000; font-family: Verdana, Arial, Helvetica, Sans-serif; font-size: 12px;">
          <tr>
            <td>
              <div id="BEGINREMOVEONREPLY">&amp;nbsp;</div>
              [HEADER]
              <div id="ENDREMOVEONREPLY">&amp;nbsp;</div>
            </td>
          </tr>
          <tr>
            <td>
              <xsl:apply-templates />
            </td>
          </tr>
        </table>
      </body>
    </html>
  </xsl:template>

  <xsl:template match="Immediate">
    <xsl:apply-templates />
  </xsl:template>

  <xsl:template match="Message">
    <div  style="font-size: 11px; color: #888; margin: 0.5em 0 0.5em 0;">
      From: <xsl:value-of select="SendersEmail" disable-output-escaping="yes" />
    </div>
    <p style="font-size: 11px; color: #888; margin: 0 0 1em 0;">
      Posted by <xsl:value-of select="AuthorName" disable-output-escaping="yes" /> on <xsl:value-of select="Created" />.
    </p>
    <div class="message">
      <xsl:value-of select="Body" disable-output-escaping="yes" />
      <xsl:value-of select="Attachment" disable-output-escaping="yes" />
    </div>
    <hr />
    <div id="BEGINREMOVEONREPLY">&amp;nbsp;</div>
    <div>
      [FOOTER]
    </div>
    <div class="footerLinks" style="font-size: 11px; color: #888;">
      [VIEWLINK] / [UNSUBSCRIBELINK] / [MYMAILINGLISTSLINK] <xsl:value-of select="Links" />
    </div>
    <div id="ENDREMOVEONREPLY">&amp;nbsp;</div>
  </xsl:template>
</xsl:stylesheet>
