Umbraco Contour XSLT transformed mail with link

Umbraco Contour seem to have a bug when sending mail out with a file upload. You would expect to get a clickable link in the email, but instead Contour inserts the file location without domain – as plain text, making it rather useless. Of course you can see the uploaded file from “Entries” in Contour, but a better and expected UX would be to be able to click the link in the mail.

As for now, this can only be done by using the type “Send xslt transformed email” from “Workflows” in Contour. Using the below XSLT file will give you a clickable link with the filename, in your received email.

When creating a “Workflow”, simply choose the type “Send xslt transformed email” and choose the XSLT file below.

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
exclude-result-prefixes="xsl msxsl user umbraco.library">

<xsl:output method="html" media-type="text/html" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
cdata-section-elements="script style"

<xsl:param name="records" />

<xsl:template match="/">
<table style="border-collapse:collapse;border:1px solid black;">
<xsl:for-each select="$records//fields/child::*">
<xsl:sort select="@sortorder" data-type="number"/>
<tr style="border:1px solid black;">
<td valign="top" style="border:1px solid black;padding:5px;font-family:Verdana,Helvetica,Arial,sans-serif;font-size:11px;">
<xsl:value-of select="./caption"/>
<td valign="top" style="border:1px solid black;padding:5px;font-family:Verdana,Helvetica,Arial,sans-serif;font-size:11px;">
<xsl:when test="contains(.//value, ‘/umbraco/plugins/umbracoContour/files/’)">
<a href="http://{umbraco.library:RequestServerVariables(‘SERVER_NAME’)}{.//value}">
<xsl:value-of select="substring-after(substring-after(.//value, ‘/files/’), ‘/’)"/>
<xsl:for-each select="./values/value">
<xsl:if test="position() &gt; 1">
<br />
<xsl:value-of select="umbraco.library:ReplaceLineBreaks(.)"/>