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).
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.
...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, 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.
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 :)
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 :-)
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...:)
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 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?
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.
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.
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:
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?
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.
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?
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
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.
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
...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
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.
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
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
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
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
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
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.
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
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.
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
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
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?
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.
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
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
is working on a reply...