By default the e-mail that is sent will be using the Example-Template.cshtml file that is located in the folder /views/partials/forms/emails/ (If accessing from the back office I believe you can get there Settings -> Partials this will take you to the partials folder on disk.
What you could then do, is find the for each loop that is going around Model.Fields (I think it's around line 151 assuming the file is currently unmodified).
You could then filter the results to make sure that there is a value in field.GetValues() (but I'm not sure what helper method there is for this) and then only put results where it's true.
That, I think, should give you what you are after, unfortunately I don't have a site to test this on for you right now so it's only theoretical but hopefully will point you in the right direction?
Umbraco Forms - send email with only filled out fields.
Hi
I am using Umbraco Forms and wonder if it is possible to send an email with a copy of a form, with only the fields that are filled out.
I totally new to Umbraco and C# in general. So if any could point me in the right direction.
Hi Christian,
In theory yes I would have thought it would be.
By default the e-mail that is sent will be using the
Example-Template.cshtml
file that is located in the folder/views/partials/forms/emails/
(If accessing from the back office I believe you can get thereSettings -> Partials
this will take you to the partials folder on disk.What you could then do, is find the for each loop that is going around Model.Fields (I think it's around line 151 assuming the file is currently unmodified).
You could then filter the results to make sure that there is a value in field.GetValues() (but I'm not sure what helper method there is for this) and then only put results where it's true.
That, I think, should give you what you are after, unfortunately I don't have a site to test this on for you right now so it's only theoretical but hopefully will point you in the right direction?
Thanks
Nik
Thanks! that was what I was looking for!
is working on a reply...