mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
APICHANGE: removed the dulicate send copy to subscriber field. This function should now all be routed through the Email Recipients function in the cms. this gives more control over the emailing to the user
This commit is contained in:
parent
1d11b9529f
commit
049d42769a
@ -27,8 +27,6 @@ class UserDefinedForm extends Page {
|
||||
* @var Array Fields on the user defined form page.
|
||||
*/
|
||||
static $db = array(
|
||||
"EmailOnSubmit" => "Boolean",
|
||||
"EmailOnSubmitSubject" => "Varchar(200)",
|
||||
"SubmitButtonText" => "Varchar",
|
||||
"OnCompleteMessage" => "HTMLText",
|
||||
"ShowClearButton" => "Boolean"
|
||||
@ -473,14 +471,6 @@ JS
|
||||
if(!empty($data[$field->Name])){
|
||||
|
||||
switch($field->ClassName){
|
||||
case "EditableEmailField" :
|
||||
if($field->SendCopy){
|
||||
$recipientAddresses[] = $data[$field->Name];
|
||||
$sendCopy = true;
|
||||
$values[$field->Title] = '<a style="white-space: nowrap" href="mailto:'.$data[$field->Name].'">'.$data[$field->Name].'</a>';
|
||||
}
|
||||
break;
|
||||
|
||||
case "EditableFileField" :
|
||||
if(isset($_FILES[$field->Name])) {
|
||||
|
||||
@ -551,18 +541,6 @@ JS
|
||||
}
|
||||
}
|
||||
|
||||
// send a copy to the author of the form
|
||||
if($sendCopy) {
|
||||
$emailToSubmiter = new UserDefinedForm_SubmittedFormEmailToSubmitter($submittedFields);
|
||||
$emailToSubmiter->setSubject($this->EmailOnSubmitSubject);
|
||||
|
||||
foreach($recipientAddresses as $addr) {
|
||||
$emailToSubmiter->setBody($this->EmailMessageToSubmitter);
|
||||
$emailToSubmiter->setTo($addr);
|
||||
$emailToSubmiter->send();
|
||||
}
|
||||
}
|
||||
|
||||
// Redirect to the finished method on this controller with the referrer data
|
||||
Director::redirect($this->Link() . 'finished?referrer=' . urlencode($data['Referrer']));
|
||||
}
|
||||
|
@ -1,12 +0,0 @@
|
||||
$Body
|
||||
|
||||
<p><% _t('SUBMITTED',"You have submitted the following information:") %></p>
|
||||
|
||||
<table>
|
||||
<% control Fields %>
|
||||
<tr>
|
||||
<td style="padding: 5px"><b>$Title</b></td>
|
||||
<td style="padding: 5px">$Value.RAW</td>
|
||||
</tr>
|
||||
<% end_control %>
|
||||
</table>
|
Loading…
Reference in New Issue
Block a user