Execute statement correctly in inserter.

Add constants for email statuses.
Make hash nullable.