added ability to insert custom template code into the registration