the no-redirect issue was related to a customhook i added to the FormIt-call...
<?php
//configuration
$mailFrom = $modx->getOption('emailsender'); //OR USE YOUR OWN;
$mailFromName = $modx->getOption('site_name'); //OR USE YOUR OWN;
$mailSender = $modx->getOption('site_name'); //OR USE YOUR OWN;
$mailSubject = 'SUBJECT';
$mailReplyTo = $mailFrom;
//get fields values so they can be replaced in the email chunk
$confirmationFields['name'] = $scriptProperties['fields']['name'];
$confirmationFields['betreff'] = $scriptProperties['fields']['betreff'];
$confirmationFields['email'] = $scriptProperties['fields']['email'];
//get user's email
$mailTo= $scriptProperties['fields']['email'];
$text = $modx->getChunk('ConfirmationTpl-Anmeldung', $confirmationFields);
$modx->getService('mail', 'mail.modPHPMailer');
$modx->mail->set(modMail::MAIL_BODY,$text);
$modx->mail->set(modMail::MAIL_FROM,$mailFrom);
$modx->mail->set(modMail::MAIL_FROM_NAME,$mailFromName);
$modx->mail->set(modMail::MAIL_SENDER,$mailSender);
$modx->mail->set(modMail::MAIL_SUBJECT,$mailSubject);
$modx->mail->address('to',$mailTo);
$modx->mail->address('reply-to',$mailReplyTo);
$modx->mail->setHTML(true);
if (!$modx->mail->send()) {
$modx->log(modX::LOG_LEVEL_ERROR,'An error occurred while trying to send the email: '.$err);
$modx->mail->reset();
return true;
}
$modx->mail->reset();
return true;
I changed line 29-32 to get a
return true, because the error is inbetween this original code-part:
if (!$modx->mail->send()) {
$modx->log(modX::LOG_LEVEL_ERROR,'An error occurred while trying to send the email: '.$err);
return false;
}
I don't understand what is the error there, because the mail gets send as wanted. So I did this dirty workaround to get my page-redirect. But I'D like to know why there is an error and how I can solve it.