There was a discussion before about this type of feature. As far as I know, nobody's built anything yet, but it'd be a pretty good module.
There are actually three ways you could approach it;
- What I suggested before which is to add the fields to the part itself; then from the part itself hook into a field rendering process to display the form. Could be really tricky tho.
- Use a ShapeTableProvider to handle Content shapes, and you can add a Wrapper template at that stage by investigating shape.ContentItem to see if it had your part, and checking other properties like DisplayType=="Detail" etc. You could make this work but
I reckon it'd be a bit flimsy and not the most flexible way.
- Most complex-sounding but probably best option; display a complete editor for the content type. This means the user can add *any* parts or fields and have them participate in the contact form; and when they'd finished, you would have their full contact
form entries in your database as a content item (which of course you'd want to keep private). You'd have to copy the Create and CreatePOST actions from AdminController in Core.Contents to have the editor appear in the front-end, and then add in your own logic
for sending an email when it's done. You wouldn't actually need to put all the inputted details into the email, because it could have a link to view the full contact details on the site. Thinking about it this might actually be easier to get working properly
than the other two options!