Hi!
It's quite easy, I've just done it, but I'm quite sure it can be done even easier.
In /templates/email/ folder you have SubmittedFormEmail.ss, where you can use something like:
<% control Fields %>
<ul>
<li><span class="emphasis">$Title</span>:
<% if Value = on %>
Yes
<% else %>
$Value
<% end_if %>
</li>
</ul>
<% end_control %>
If you want to use specific templates, the only way I have found is to to create a new Page type where you subclass UserDefinedForm, UserDefinedForm_controller and Email (look at UserDefinedForm.php). In MyFantasticUserDefinedForm_controller you must have a process() method where you replace:
$email = new UserDefinedForm_SubmittedFormEmail($submittedFields);
…with the name of the custom Email subclass.
In this custom process() method you can add data to your email template via the $emailData array, e.g.:
$emailData = array(
"Sender" => Member::currentUser(),
"Fields" => $submittedFields,
// Added for sending different messages to clients and admin
"ForAdmin" => true
);
Then, for example where it says later:
if($recipient->SendEmailFromFieldID) {
// Used in template if for hiding form fields from clients
$emailData['ForAdmin'] = false;
Then, in your custom email template:
<h2>$Subject</h2>
$Body
<% if ForAdmin %>
<% control Fields %>
<p>
<span class="emphasis">$Title</span></br>
<% if Value %>
<% if Value = --choissisez-- %>
<span style="color:red">Non renseigné</span>
<% else %>
$Value
<% end_if %>
<% else %>
<span style="color:red">Non renseigné</span>
<% end_if %>
</p>
<% end_control %>
<% end_if %>
In this way, the admin receives a message with all the fields of the form and the client only a message with the $Body defined in the CMS, for example saying ‘Form received, thanks!’.
Hope it helps,
Juan