Only sending email if a user was registered in the DB

Closes #1