updates to codes/hooks and how server sends emails