Adding email export functionality