Add email sending, refactored hash func of orders