Creating CSV and adding it as an attachment to the email when export selected is clicked