Added checking user permissions before emailing