added code for contact page, email templates, fixed reference errors