Hi, ich habe ein Formular, dass nach dem Versand via Ajax ein OK zurück geben soll.
Dafür kann ja scheinbar die KLasse FormResponse benutz werden. Allerdings tut sich bei mir nichts.
Muss ich irgendwas regestrieren oder so?
hier mal die Funktion,.. sie befindet sich im Controller
function DoMyCustomForm($data, $form) {
$from = $data['Email'];
$to = xyz@xyz.com";
$subject = 'Silverstripe Mail';
$body = $data['Name']."<br>";
$body .= $data['Firma']."<br>";
$body .= $data['Ort']."<br>";
$body .= $data['PLZ']."<br>";
$body .= $data['Email']."<br>";
$body .= $data['Nachricht'];
$email = new Email($from, $to, $subject, $body);
$email->sendPlain();
FormResponse::update_dom_id('footer', '<form>myformcontent</form>');
// FormResponse::status_message('Done', 'good');
// will automatically show the status-message if called by ajax, or redirect on a normal HTTP-request
return FormResponse::respond();
//Director::redirectBack();
//Director::redirect('thanks-for-contact/');
}
Danke im Voraus

