How to send a single email after csv file saved and attached to email output plugin

you can send email only when the file is available
Attachment should be a existing file name with path

But in my case i have to save the csv file and send mail with the saved csv file, Both should be done one after another in in single logstash conf file