Copied to clipboard

Flag this post as spam?

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


  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Apr 11, 2016 @ 18:19
    Jan Skovgaard
    0

    XSLT formatted email in Umbraco Forms

    Hi guys

    I'm currently scratching my head about how to customize an Umbraco forms e-mail using the "Send XSLT transformed e-mail" workflow.

    However I'm a bit puzzled about this and for some reason I can't seem to find the documentation on how to do it. I have checked the documentation here https://github.com/umbraco/UmbracoFormsDocumentation - But perhaps I'm just blind? :) - So is it supported or not? If so what would an approach of doing it be?

    EDIT: Forgot to mention that I'm using Umbraco Forms 4.2.1 - When selecting the "Send XSLT transformed e-mail" workflow I see a "Pick" button...When clicking on it the Media dialog is triggered...not sure why? Is one supposed to upload the XSLT file that should be used to transform the e-mail? Or is this a bug? (Have not checked the issue tracker yet).

    Cheers, Jan

  • Nicholas Westby 2054 posts 7103 karma points c-trib
    Apr 11, 2016 @ 18:23
    Nicholas Westby
    0

    IIRC, Send XSLT transformed e-mail is a Contour Contrib workflow. That is, it is not part of the core, but is part of an extension.

    https://our.umbraco.org/projects/developer-tools/contour-contrib

    If there is documentation for Contour Contrib, I imagine that's where you'd find info about Send XSLT transformed e-mail.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Apr 11, 2016 @ 18:29
    Jan Skovgaard
    0

    Hi Nicholas

    Yup in the old days :) - Now it seems that the intention is to have it as a part of the core - At least there is a "Send as XSLT transformed e-mail" option.

    Just gotta figure out how it's supposed to work. Thanks for the input though.

    /Jan

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Apr 11, 2016 @ 18:35
    Jan Skovgaard
    1

    ...Ok, so it seems that one actually just have to upload the desired XSLT file for formatting the e-mail...that seems a bit odd though...nonetheless it actually works.

    I just did a test using the sample XSLT file in the /App_Plugins/UmbracoForms/Xslt/sendXsltEmailSample.xslt and the e-mail was being transformed against it.

    Not sure why it's not possible to simply pick a XSLT file directly from the developer section though but hope others can benefit from my approach. Next I'm going to copy the sample file into the XSLT directory in Umbraco instead and then upload this file to the media archive.

    /Jan

  • bob baty-barr 1180 posts 1294 karma points MVP
    Apr 11, 2016 @ 18:40
    bob baty-barr
    1

    Jan, you have the workflow correct... you upload a new xstl transform via the interface within forms/contour... it does feel very disconnected from the rest of the mechanisms... but it is -- maybe float this by Warren for future consideration.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Apr 11, 2016 @ 18:43
    Jan Skovgaard
    0

    Thanks for getting back to me Bob and confirming that this currently is the way to do it - I guess it might make a bit more sense towards an editor to point at something in the media section rather than the developer section, which would probably be confusing towards them so perhaps it makes sense afterall :)

    /Jan

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Apr 11, 2016 @ 19:58
    Chriztian Steinmeier
    2

    It makes no sense at all :-)

    I honestly thought it was a bug the last time I tried it, and I kinda didn't feel like logging a bug that had anything to do with XSLT, because... well because I'm constantly being told that no-one uses that anymore... (but let's not get into that :-)

    /Chriztian

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Apr 12, 2016 @ 07:27
    Jan Skovgaard
    0

    Yeah I agreee actually - What I meant was that it probably makes more sense for an editor to pick it from the media section rather than the developer section...even though the editor is probably very very confused abot what that XSLT stuff is and why they have to select it...so...yeah...:)

    XSLT rocks and always will. Period! :)

    /Jan

  • Warren Buckley 2106 posts 4836 karma points MVP 7x admin c-trib
    Apr 12, 2016 @ 06:47
    Warren Buckley
    1

    Hi Guys,
    Yes I must admit it a weird quirk currently, that you cannot simply pick an XSLT file from disk but instead have to explicitly upload one instead.

    I can add this to the issue tracker now so that it does not get forgotten about.

    Thanks,
    Warren

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Apr 12, 2016 @ 07:31
    Jan Skovgaard
    1

    Hi Warren

    Thanks for chiming in on this - I think the whole workflow around how to customize the email should be reconsidered since I noticed that when choosing the "transformed email workflow" thing then the "Message" field disappears and so does the "Attach to email" option.

    I think that the two fields should still be there and then we as developers can decide how the fields (except uploaded stuff since I think that should be attached like when using the standard flow) should be rendered.

    Perhaps it's also worth considering if we should be allowed to rename the workflows to have some more editor friendly names?

    Just my 2 cents - I'll be happy to create one or more issues if you would like. But perhaps the whole workflow thing should be reconsidered a bit?

    /Jan

  • Darrell Childers 9 posts 109 karma points
    Dec 21, 2016 @ 18:15
    Darrell Childers
    0

    I've been fighting this thing for a week now and I cannot get the submitted form to send an email using an uploaded xslt file. I just don't get it. Contour was so easy to configure an XSLT file and import it as a macro on the landing page. I've tried that in Umbraco 7.5.4 with Forms installed but it fails with this error:

    "Cannot find a script or an extension object associated with namespace 'urn:umbraco.contour'. "

    Every time I try just using the sample provided, absolutely nothing happens. The documentation on this is severely lacking.

  • Warren Buckley 2106 posts 4836 karma points MVP 7x admin c-trib
    Jan 03, 2017 @ 08:43
    Warren Buckley
    0

    Hello Darrell,
    Where are you getting the sample XSLT file from?

    The error or problem is that the XSLT file is trying to import a namespace that does not exist which is Contour.

    This indicates that this is an old sample XSLT file or that the one provided is out of date & needs updating.

    Can you post your full XSLT file here so that myself others from the community can help you.

    Thanks,
    Warren

  • Darrell Childers 9 posts 109 karma points
    Jan 05, 2017 @ 18:21
    Darrell Childers
    0

    The error I displayed was due to trying to incorporate an old Contour xslt script into the file and import it as a macro on the landing page, so my issue description wasn't written very well. This was the process I used in the previous version of Umbraco. Since I wasn't receiving the email from the sample xslt file I decided to try the old way. Sorry about that.

    I was able to resolve the problem and it wasn't a problem with Umbraco or the xslt file. Our exchange server wasn't configured to send email to external email addresses.

    Now that I'm able to get the email to send, I need to make it dynamic so that I only send the information I want to send, AND send it to the person who submits the form. Is this possible? Is there a way I can enter a value for the Email text box on the workflow form (like {submitteremail})? If I just leave that text box blank can I configure the xslt file to grab the submitteremail from the Umbraco Form? Contour was so much easier to use than Forms.

    Thanks for the response.

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Jan 05, 2017 @ 23:17
    Chriztian Steinmeier
    2

    Hi Darrel,

    Have a look at this page about Magic Strings in Umbraco Forms, which should be the information you're looking for...

    Hope that helps,

    /Chriztian

  • Darrell Childers 9 posts 109 karma points
    Jan 09, 2017 @ 16:08
    Darrell Childers
    1

    Thanks Chriztian. That really helped a lot. I'm wondering now if there's a more elegant way to get the form values into the XSLT file than this:

    <xsl:variable name="subscriptionEmailTo" select="$records//fields/child::* [caption = 'Please confirm the email address to update:']//value"/>

    or this:

    <xsl:value-of select="$records//fields/child::* [caption = 'Please confirm the email address to update:']//value"/>

    Both work but it looks clunky to me. Here's the way I did it when using Contour:

    <xsl:variable name="subscriptionEmailTo" select="$records/fields/pleaseconfirmtheemailaddresstoupdate//value"/>

    Not a big deal but it seems like there should be a better way.

    Thanks, Darrell

  • Darrell Childers 9 posts 109 karma points
    Feb 06, 2017 @ 22:41
    Darrell Childers
    0

    I have a new question about retrieving values from an Umbraco 7 Form and sending email with those values. If I'm getting values from a radio button list I use something like this:

    <xsl:for-each select="$rsvpNewAttendee"> <xsl:choose> <xsl:when test="$rsvpNewAttendee != ''"> <strong>New Attendee:</strong> <xsl:value-of select="$rsvpNewAttendee"/><br /> </xsl:when> </xsl:choose> </xsl:for-each>

    That works fine. However, if I'm trying to get values from a check box list, I use the same code but it doesn't return the value for each one checked. It'll return the value for the 1st one checked, multiple times. Can someone point me in the correct direction for this?

  • Darrell Childers 9 posts 109 karma points
    Feb 07, 2017 @ 15:50
    Darrell Childers
    0

    I'm sure this is not the best way to handle this but everything else failed, even trying to use the split function. There has got to be a more efficient and cleaner way to write this code.

    <xsl:when test="$rsvpMeetings != ''">
    <ul>
    <xsl:for-each select="$rsvpMeetings">
        <xsl:choose>
            <xsl:when test=". = 'February 10th'">
                <li>February 10th</li>
            </xsl:when>
            <xsl:when test=". = 'May 12th'">
                <li>May 12th</li>
            </xsl:when>
            <xsl:when test=". = 'September 22nd'">
                <li>September 22nd</li>
            </xsl:when>
        </xsl:choose>
    </xsl:for-each>
    </ul></xsl:when>
    
  • Colm Garvey 40 posts 65 karma points
    Feb 24, 2017 @ 14:37
    Colm Garvey
    0

    I'm struggling with this too and all I want is pretty standard Form functionality:

    ==================================

    To: {emailAddress}

    From {localBranchEmail}

    Dear {firstName}

    Thanks for your email.

    We'll get back to you within 24 hours

    Sincerely

    {branchName} Customer Support

    ==================================

    where "emailAddress" and "firstName" are the email address and name the User has supplied when filling out the form and all the other "Magic Strings" are Page Attributes.

    Is there an example anywhere detailing how to do this?

    Many thanks,

    Colm

  • Sam 1 post 71 karma points
    Feb 07, 2018 @ 16:30
    Sam
    0

    That's pretty much what I'm trying to achieve as well but have yet to find any examples

    I'm new to xslt coding so there's a chance I may have come across it but not realised due to not understanding it

    Hopefully someone can come along and provide help

Please Sign in or register to post replies

Write your reply to:

Draft