Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Christian Palm 277 posts 272 karma points
    Mar 07, 2011 @ 15:14
    Christian Palm
    3

    Send xslt transformed email: Here is my xslt email template

    Hi - This is just a share of my xslt email template when using the workflow "Send xslt transformed email".

    Some simple table layout and it handles file uploads, fields with more than one input and replaces linebreakes with <br />

    <?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"
    xmlns:user="urn:my-scripts"
    xmlns:umbraco.library="urn:umbraco.library"
    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"
      doctype-system="DTD/xhtml1-strict.dtd"
      cdata-section-elements="script style"
      indent="yes"
      encoding="utf-8"/>

      <xsl:param name="records" />

      <xsl:template match="/">
      <table style="border-collapse:collapse;border:1px solid black;">
      <xsl:for-each select="$records//fields/child::*">
      <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;">
      <strong>
    <xsl:value-of select="./caption"/>
      </strong>
      </td>
      <td valign="top" style="border:1px solid black;padding:5px;font-family:Verdana,Helvetica,Arial,sans-serif;font-size:11px;">
      <xsl:choose>
      <xsl:when test="contains(.//value, '/umbraco/plugins/umbracoContour/files/')">
      <a href="http://{umbraco.library:RequestServerVariables('SERVER_NAME')}{.//value}">
      <xsl:value-of select=".//value"/>
      </a>
      </xsl:when>
      <xsl:otherwise>
      <xsl:for-each select="./values/value">
      <xsl:if test="position() &gt; 1">
      <br />
      </xsl:if>
      <xsl:value-of select="umbraco.library:ReplaceLineBreaks(.)"/>
      </xsl:for-each>
      </xsl:otherwise>
      </xsl:choose>
    </td>
      </tr>
      </xsl:for-each>
      </table>
      </xsl:template>

    </xsl:stylesheet>
  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 07, 2011 @ 17:23
    Jan Skovgaard
    0

    Hi Christian

    Thanks for sharing this - sure will come in handy. Perhaps it should also be created in the wiki? Don't know, which one is easier to find on a search.

    /Jan

  • Fuji Kusaka 2203 posts 4220 karma points
    Aug 09, 2011 @ 18:47
    Fuji Kusaka
    0

    Hi Christian,

    Can you explain to me how do i get only 2 specific fields instead of displaying all?

     

  • Fuji Kusaka 2203 posts 4220 karma points
    Aug 10, 2011 @ 11:52
    Fuji Kusaka
    1

    Hi Christian,

    I finally got it working and if you dont mind i'll just add my code down here for others if ever you guys have the same demand as per my clients request.

    So basically the client wanted on Submit the User will be redirected to the Confirmation page but will also get an email confirmation with the Gender, Name and Surname as per the input.

    <xsl:param name="records"/>

    <xsl:template match="/">
    <p>  
      Dear 
    <xsl:value-of select="$records//fields/child::* [caption = 'Gender']//value"/>&#160;<xsl:value-of select="$records//fields/child::* [caption = 'First Name']//value"/>&#160;<xsl:value-of select="$records//fields/child::* [caption = 'Last Name']//value"/>, thank you for your application.........
      </p> 
    </xsl:template>

     

    //Fuji


     


     

  • Niels 63 posts 119 karma points
    Nov 18, 2011 @ 13:56
    Niels
    0

    Hi Christian,

    Is it possible to add an attachment(pdf) to a confirmation-mail without the use of an uploadfield?

  • Fredrik Esseen 609 posts 905 karma points
    Dec 02, 2011 @ 10:14
    Fredrik Esseen
    0

    Hi!

    Thank you for the template!

    Very useful.

    I have some checkboxes and in the email the value will be "True" or "False". Ive tried to replace the text but dont really get it right.

    is there an easy way to do this?

  • Fuji Kusaka 2203 posts 4220 karma points
    Dec 02, 2011 @ 11:12
    Fuji Kusaka
    0

    Hi Froad,

    Am not sure if you can change the outcome "True" or "False".

  • Paul Stewart 50 posts 71 karma points
    Jan 10, 2012 @ 12:54
    Paul Stewart
    0

    Im having the same issue..

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jan 10, 2012 @ 21:25
    Jan Skovgaard
    0

    Hi Paul

    What is your issue? Does the email not get send or what is it exactly that you can't get to work? And do you receive any kind of error message?

    /Jan

  • Paul Stewart 50 posts 71 karma points
    Jan 11, 2012 @ 10:07
    Paul Stewart
    0

    I've basically resolved it, but there is something that is preventing depending what you type in the dictionary item.

    this was what my initial problem was but manage to solve it in a way, but when ever you add the word "to" in a dictionary item, the xslt email through contour does not send. So cant understand why thats not working.

    http://our.umbraco.org/forum/umbraco-pro/contour/27462-XSLT-Single-Checkbox

     

Please Sign in or register to post replies

Write your reply to:

Draft