Hi guys,
there are so many request for this feature that I will give a description how to fix it here. I will include this changes into the source code of Visforms and they will be part of the next release. So you can make the following changes to the code without fear of loosing them on the next update of Visforms.
The changes are the same for visforms 2.0.x and 3.0.x. They are not meant for Visforms 1.0 Versions!
Go to components/com_visforms/models/visforms.php, make a backup copy of this file and open it.
At about line 808 you find the section "Send Email Result"
find the line
Code:
$mailBody = $mailBody."registered at ".date("Y-m-d H:i:s")."<br /><br />\n\n";
(about 5th line in the first if statement)
replace it with
Code:
$mailBody = $mailBody."registered at ".date("Y-m-d H:i:s")."<br /><br />\n\n";
$emailSender = "";
find the line
Code:
$field = $visform->fields[$i];
(just 2 or 3 lines below, right at the top of the following for-Statement)
replace it with
Code:
$field = $visform->fields[$i];
if ($field->typefield == 'email')
{
if (isset($field->postValue))
{
$emailSender = $field->postValue;
}
}
find line
Code:
$mail->setSender( array( $visform->emailfrom, $visform->emailfromname ) );
about 50 lines below but before "Send Email Receipt" section
Replace it with
Code:
if ($emailSender == "")
{
$emailSender = $visform->emailfrom;
}
$mail->setSender( array( $emailSender, $visform->emailfromname ) );
That's it.
Good luck and kind Regards,
Aicha