protected function onFakeSubmit()
    {
        if (isset($this->formData['create_account']) && $this->formData['create_account']) {
            $mail = $this->loader->getMailLoader()->getMailer('staffPassword', $this->user->getUserId());
            if ($mail->setCreateAccountTemplate()) {
                $mail->send();
                $this->addMessage($this->_('Create account mail sent'));
                $this->setAfterSaveRoute();
            } else {
                $this->addMessage($this->_('No default Create Account mail template set in organization or project'));
            }
            return;
        }

        if (isset($this->formData['reset_password']) && $this->formData['reset_password']) {
            $mail = $this->loader->getMailLoader()->getMailer('staffPassword', $this->user->getUserId());
            if ($mail->setResetPasswordTemplate()) {
                $mail->send();
                $this->addMessage($this->_('Reset password mail sent'));
                $this->setAfterSaveRoute();
            } else {
                $this->addMessage($this->_('No default Reset Password mail template set in organization or project'));
            }
        }
    }
protected function onFakeSubmit()
    {
        if (isset($this->formData['create_account']) && $this->formData['create_account']) {
            $mail = $this->loader->getMailLoader()->getMailer('staffPassword', $this->user->getUserId());
            if ($mail->setCreateAccountTemplate()) {
                $mail->send();
                $this->addMessage($this->_('Create account mail sent'));
                $this->setAfterSaveRoute();
            } else {
                $this->addMessage($this->_('No default Create Account mail template set in organization or project'));
            }
            return;
        }

        if (isset($this->formData['reset_password']) && $this->formData['reset_password']) {
            $mail = $this->loader->getMailLoader()->getMailer('staffPassword', $this->user->getUserId());
            if ($mail->setResetPasswordTemplate()) {
                $mail->send();
                $this->addMessage($this->_('Reset password mail sent'));
                $this->setAfterSaveRoute();
            } else {
                $this->addMessage($this->_('No default Reset Password mail template set in organization or project'));
            }
        }
    }
protected function onFakeSubmit ( ) { if ( isset ( $ this -> formData [ 'create_account' ] ) && $ this -> formData [ 'create_account' ] ) { $ mail = $ this -> loader -> getMailLoader ( ) -> getMailer ( 'staffPassword' , $ this -> user -> getUserId ( ) ) ; if ( $ mail -> setCreateAccountTemplate ( ) ) { $ mail -> send ( ) ; $ this -> addMessage ( $ this -> _ ( 'Create account mail sent' ) ) ; $ this -> setAfterSaveRoute ( ) ; } else { $ this -> addMessage ( $ this -> _ ( 'No default Create Account mail template set in organization or project' ) ) ; } return ; } if ( isset ( $ this -> formData [ 'reset_password' ] ) && $ this -> formData [ 'reset_password' ] ) { $ mail = $ this -> loader -> getMailLoader ( ) -> getMailer ( 'staffPassword' , $ this -> user -> getUserId ( ) ) ; if ( $ mail -> setResetPasswordTemplate ( ) ) { $ mail -> send ( ) ; $ this -> addMessage ( $ this -> _ ( 'Reset password mail sent' ) ) ; $ this -> setAfterSaveRoute ( ) ; } else { $ this -> addMessage ( $ this -> _ ( 'No default Reset Password mail template set in organization or project' ) ) ; } } }
Hook that allows actions when the form is submitted, but it was not the submit button that was checked

When not rerouted, the form will be populated afterwards
Hook that allows actions when the form is submitted but it was not the submit button that was checked