Alternate templates with Mail engine

I recently downloaded the excellent package Mail Engine from Tim’s blog.  This package rocks.  One issue I had was being able to have an alternate template for the newsletter im sending out. A newsletter template with minimal furniture would be ideal. However the current version of mail engine does not support alternate templates.  So I did the following:

  1. Created newsletters doctype with one property umbracoNaviHide (true/false)
  2. Created newsletter doc type with one property with alias sourceNode and type content picker.
  3. Created a node of type newsletters in the root of the site
  4. Created a node of type newsletter in newsletters (step 3) and picked the document I wanted to email using the content picker
  5. Added XSLT macro called GetContentForEmail that i created which has the following code
    <xsl:if test="$currentPage/data&#91;@alias='sourceNode'&#93;!='' and umbraco.library:QueryForNode($currentPage/data&#91;@alias='sourceNode'&#93;)">
    <xsl:value-of select="umbraco.library:GetItem($currentPage/data&#91;@alias='sourceNode'&#93;, 'bodyText')" disable-output-escaping="yes"/>
  6. Created template for newsletter that uses macro from step 5 and in head tag added style tag with styles for formatting the page

I then sent this page as an email.  Bascially now works like ultrasimple mailer used to.

The new blog

As some of you may already have noticed the old blog at is no more.  It died after the umbraco server move the old blog was mostly v3 stuff and it looked pants. So I have created a new blog on word press, you already get nice theme, plugins etc.  Still need to figure out how to host zip files.  Anyhow I will carry on with my 5 pence worth on umbraco and other stuff here.