ENHANCEMENT: can now send submitted data (via email) to submitter and site owner individually or both at the same time

This commit is contained in:
Saophalkun Ponlu 2009-02-11 02:27:55 +00:00
parent e2f47e41c3
commit 459c127d51

View File

@ -371,13 +371,14 @@ class UserDefinedForm_Controller extends Page_Controller {
}
if( $this->EmailOnSubmit || $sendCopy ) {
$emailData = array(
"Recipient" => $this->EmailTo,
"Sender" => Member::currentUser(),
"Fields" => $submittedFields,
);
// Extract email data
$emailData = array(
"Recipient" => $this->EmailTo,
"Sender" => Member::currentUser(),
"Fields" => $submittedFields,
);
if( $this->EmailOnSubmit ) {
$email = new UserDefinedForm_SubmittedFormEmail($submittedFields);
$email->populateTemplate($emailData);
$email->setTo( $this->EmailTo );
@ -391,7 +392,9 @@ class UserDefinedForm_Controller extends Page_Controller {
}
$email->send();
}
if($sendCopy) {
// send to each of email fields
$emailToSubmiter = new UserDefinedForm_SubmittedFormEmailToSubmitter($submittedFields);
$emailToSubmiter->populateTemplate($emailData);