added return values to email functions. added reset password email function.
Merge origin/master