BPM - Send Email with CSV file attachment

Hello everyone!
I have created an Updatable dashboard and have also did some BPM to send emails based on the selection. I would like to know how can i generate a CSV file of the selected rows and send it as an attachment. Here is an image of my dashboard