Copied to clipboard

Flag this post as spam?

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


  • Søren Reinke 158 posts 206 karma points c-trib
    Jun 28, 2011 @ 13:21
    Søren Reinke
    0

    XSLT to generate plain text email

    Hi there

    Has any of you a XSLT file for generating pure plain text emails when a form is submitted in Contour ?

    I just need the field to be outputtet as:

     

    Company Name Name

    Company Address Road 117

     

    and so forth.

     

    I tried to make my own XSLT, but it looks like the formatting is still html, and therefore the linefeeds are not being shown.


    I used this XSLT

     

    <xsl:stylesheet 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" version="1.0" exclude-result-prefixes="xsl msxsl user umbraco.library">
        <xsl:output method="text" encoding="utf-8" media-type="text/plain"/>
        <xsl:param name="records"/>
        <xsl:template match="/">
            <xsl:for-each select="$records//fields/child::*">
                <xsl:value-of select="./caption"/>
                <xsl:text>&#9;</xsl:text>
                <xsl:value-of select=".//value"/>
                <xsl:text>&#xa;</xsl:text>
            </xsl:for-each>
        </xsl:template>
    </xsl:stylesheet>

    I get this output, when view source in outlook:

    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">Field1   1234
    Field2 345

     

    Hope you can help.

     

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Jun 28, 2011 @ 14:06
    Tom Fulton
    0

    Hi,

    I believe the built in "Send email" workflow hardcodes the MailMessage to use HTML.  If you want to use plain text, you might need to create a custom workflow

    -Tom

  • Søren Reinke 158 posts 206 karma points c-trib
    Jun 28, 2011 @ 14:14
    Søren Reinke
    0

    Hi Tom

    I was afraid of that.

    Hopefully they will fix that (in my oppinion) design error in a later version. 

Please Sign in or register to post replies

Write your reply to:

Draft