mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
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:
parent
e2f47e41c3
commit
459c127d51
@ -371,13 +371,14 @@ class UserDefinedForm_Controller extends Page_Controller {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if( $this->EmailOnSubmit || $sendCopy ) {
|
// Extract email data
|
||||||
$emailData = array(
|
$emailData = array(
|
||||||
"Recipient" => $this->EmailTo,
|
"Recipient" => $this->EmailTo,
|
||||||
"Sender" => Member::currentUser(),
|
"Sender" => Member::currentUser(),
|
||||||
"Fields" => $submittedFields,
|
"Fields" => $submittedFields,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if( $this->EmailOnSubmit ) {
|
||||||
$email = new UserDefinedForm_SubmittedFormEmail($submittedFields);
|
$email = new UserDefinedForm_SubmittedFormEmail($submittedFields);
|
||||||
$email->populateTemplate($emailData);
|
$email->populateTemplate($emailData);
|
||||||
$email->setTo( $this->EmailTo );
|
$email->setTo( $this->EmailTo );
|
||||||
@ -391,7 +392,9 @@ class UserDefinedForm_Controller extends Page_Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$email->send();
|
$email->send();
|
||||||
|
}
|
||||||
|
|
||||||
|
if($sendCopy) {
|
||||||
// send to each of email fields
|
// send to each of email fields
|
||||||
$emailToSubmiter = new UserDefinedForm_SubmittedFormEmailToSubmitter($submittedFields);
|
$emailToSubmiter = new UserDefinedForm_SubmittedFormEmailToSubmitter($submittedFields);
|
||||||
$emailToSubmiter->populateTemplate($emailData);
|
$emailToSubmiter->populateTemplate($emailData);
|
||||||
|
Loading…
Reference in New Issue
Block a user