adds CSV export and cleans up email template