Fix formatting
Add checks for email env variables