added some functionality to send a welcome email after a successful signup
added some phpdoc block content and reformatted the error checking