Hello,
I wrote a hook for the registration process. This hook should write some data in a custom table.
When I am testing the snippet as stand alone, outside the registration process, it works fine.
So I wrote a easy snippets that only creates an session variable und write it to the error log.
$email = $hook->getValue('email') ? $modx->getOption('email', $scriptProperties) : "";
$code = $hook->getValue('access_code') ? $modx->getOption('accessCode', $scriptProperties) : "";
$_SESSION['registration'] = true;
$_SESSION['registrationData'] = array('email' => $email, 'code' => $code);
$modx->log(modX::LOG_LEVEL_ERROR,'Test if sendmail is fired: '.$email);
But this hook is also not fired as posthook. The user is always created.
Some infos about my system:
- MODX Version: 2.2.11 traditional
- PHP Version: 5.4.4 auf Debian 7.1
- Database(MySQL, SQL Server, etc) Version:5.5.31-0+wheezy1
- Other Info: Debian 7.1 wheezy in VirtualBox
Does sombody habe any idea? Here is the call of the registration snippet.
[[!Register?
&activation=`0`
&activationEmailSubject=`Registrierung Theodor Secret Area Account`
&activationEmailTpl=`emailRegisterTheodorAccount`
&submitVar=`register`
&submittedResourceId=`793`
&usernameField=`email`
&usergroups=`Theodor1`
&placeholderPrefix=`reg.`
&validate=`fullname:required,
email:required:email,
password:required:minLength=^8^,
&postHooks=`accessCodeSetAsUsed`
]]
[[!$formRegisterSimple]]`]]
Thanks for helping or any ideas.
Greetings
Florian