Umbraco Forms email workflow - Full path of uploaded files or files as attachments
Currently the file attachments are shown as relative path starts with ~/media/forms/upload/ . To view the file, the user has to copy the path and append the domain name in the start.
It will be much better if the full path is shown in the email - or attach the files with the email.
We have to make custom workflow just becuase of this issue and now stuck with another bug I have reported here.
If you are using the latest version of Umbraco Forms at the moment 4.1.0, then you have the option to choose that uploaded files should be as attachments in the email.
Okay if you are working with your site local then you should try use SMTP4Dev, https://smtp4dev.codeplex.com to test if you are getting mail on localhost using this program.
If you do then you know that there is something wrong with you SMTP settings in the web.config.
Unfortunately, I don't get the email in SMTP4Dev. If I uncheck "Attach file uploads to email" it works but with this option checked I don't get the email. It seems that my SMTP config is correct.
This is the error that I get when try to send an email with attachement and with "Attach file uploads to email" checked:
There was a problem sending an email to '[email protected]' from Workflow for Form 'Form test' with id '910f6d62-f344-47fc-ae94-fdd31508ac24' for Record with unique id '7114907a-0414-414e-812d-bced4dc15b18'
System.IO.DirectoryNotFoundException: Could not find a part of the path 'D:\home\site\wwwroot\media\forms\upload\form_910f6d62-f344-47fc-ae94-fdd31508ac24\161b54bd-7753-4fd6-a29c-48812cb6e4d5\topics.png'.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at System.Net.Mail.AttachmentBase.SetContentFromFile(String fileName, String mediaType)
at System.Net.Mail.Attachment..ctor(String fileName)
at Umbraco.Forms.Core.Providers.WorkflowTypes.SendEmail.Execute(Record record, RecordEventArgs e)
If I replace D:\home\site\wwwroot\ with my domain I can access the image.
Thanks Chriztian - yes we do something similar with Razor for Contour forms. It works with new Umbraco Forms as well but we couldnt find a way to sort the fields as it appears in the frontend. Probably something that will be fixed in next release of Umbraco Forms.
I'm having a similar issue, however, I'm using Contour forms, which are missing the option to attach files to emails? Does anyone have any experience using Contour forms and how I could potentially get round the issue?
The attachments that Dennis pointed out are a great feature that I didn't know, so thanks for that.
On the other hand, the original question has still not been answered. How do you get Umbraco Forms to create absolute paths for the document links? Having the "~/media/forms/..." path means next to nothing to the user if they can't click it and view the file.
There has to be a better way than to manually add the host name in the Forms templates, as Chriztian suggested.
I hate to dig up an old post, but has anyone ever resolved this?
I'd love to get a copy of the original Workflow C# class for "Send Email" just so I can change that relative link to an absolute one. The relative link URL in an email is absolutely useless but otherwise the email workflow is perfect.
I know there is an option to attach files to the email, however the form I'm working with permits users to upload large files, sometimes in excess of 50MB, and email attachments aren't an option here.
Umbraco Forms email workflow - Full path of uploaded files or files as attachments
Currently the file attachments are shown as relative path starts with ~/media/forms/upload/ . To view the file, the user has to copy the path and append the domain name in the start.
It will be much better if the full path is shown in the email - or attach the files with the email.
We have to make custom workflow just becuase of this issue and now stuck with another bug I have reported here.
https://our.umbraco.org/forum/umbraco-pro/contour/64153-Umbraco-Forms-How-to-sort-recordsRecordFields-as-it-appears-in-the-frontend
Any help on one of these things (fullpath/attachment or proper sortorder for custom workflow) will be greatly appreciated.
Hi Anz,
If you are using the latest version of Umbraco Forms at the moment 4.1.0, then you have the option to choose that uploaded files should be as attachments in the email.
If you go to the workflows, and click on submitted workflow you have the option to click attach file uploads to email. Here is the documentation about attaching workflows https://our.umbraco.org/documentation/Products/UmbracoForms/Editor/Attaching-Workflows
Hope this can be an option for you to solve your case.
/Dennis
Hi Dennis,
I have the option of attaching files to email, but if I check that I don't receive the email.
Any help?
Thanks, Florin
Hi Florin,
Okay if you are working with your site local then you should try use SMTP4Dev, https://smtp4dev.codeplex.com to test if you are getting mail on localhost using this program.
If you do then you know that there is something wrong with you SMTP settings in the web.config.
Hope this helps,
/Dennis
Hi Dennis,
Unfortunately, I don't get the email in SMTP4Dev. If I uncheck "Attach file uploads to email" it works but with this option checked I don't get the email. It seems that my SMTP config is correct.
Thanks, Florin
Hi Dennis,
This is the error that I get when try to send an email with attachement and with "Attach file uploads to email" checked:
If I replace D:\home\site\wwwroot\ with my domain I can access the image.
I really appreciate any help.
Thanks, Florin
Hi Anz,
I've been doing something in Contour at some point where we were using the "Send XSLT transformed e-mail" action/trigger/workflow.
I tackled it with this template in the XSLT, to provide a link to the file:
- but it sounds like that's not an option for you, or maybe I'm not really understanding your problem?
/Chriztian
EDIT: Never mind me, sounds like Dennis has tried the Forms stuff :-)
Thanks Dennis. It works great :)
Thanks Chriztian - yes we do something similar with Razor for Contour forms. It works with new Umbraco Forms as well but we couldnt find a way to sort the fields as it appears in the frontend. Probably something that will be fixed in next release of Umbraco Forms.
Hi,
I'm having a similar issue, however, I'm using Contour forms, which are missing the option to attach files to emails? Does anyone have any experience using Contour forms and how I could potentially get round the issue?
Many thanks,
Andy
Use Contour Contrib
https://our.umbraco.org/projects/developer-tools/contour-contrib
Anz, this is exactly what I was after, works like a treat! Thank you so much!
The attachments that Dennis pointed out are a great feature that I didn't know, so thanks for that.
On the other hand, the original question has still not been answered. How do you get Umbraco Forms to create absolute paths for the document links? Having the "~/media/forms/..." path means next to nothing to the user if they can't click it and view the file.
There has to be a better way than to manually add the host name in the Forms templates, as Chriztian suggested.
No progress here yet?
Why is there not just a checkbox on the xslt tranformed email for attaching files?
I hate to dig up an old post, but has anyone ever resolved this?
I'd love to get a copy of the original Workflow C# class for "Send Email" just so I can change that relative link to an absolute one. The relative link URL in an email is absolutely useless but otherwise the email workflow is perfect.
I know there is an option to attach files to the email, however the form I'm working with permits users to upload large files, sometimes in excess of 50MB, and email attachments aren't an option here.
I think the issue with bringing back this post in particular is that it appears to have been "answered" and may get ignored by the Forms team.
is working on a reply...