We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • Target: Registering a new user with the Register snippet without a filled email field (The validation is done by SMS code).

    During my tests it seems that the email field is required, even if it is not mentioned in &validate. Bad enough, the preHook is working after the validation.

    But it is possible bypassing that problem. First add a hidden field in the form with the email:
    <input type="hidden" name="email" value="[[++emailsender]]" />
    

    The value is only a dummy and will be overwritten later by the following preHook:
    <?php
    $hook->setValue('email', '');
    return true;
    ?>