Why this and not that
Every cell quoted and its quotes doubled, which is the whole of CSV escaping: a name with a comma or a quote in it stays in its column. A cell that starts with =, +, - or @ gets a leading apostrophe, because a spreadsheet runs it as a formula, and product names and form answers are typed by people you do not control.
A folder and a random part in the filename. A file saved without a folder goes in the batch's own folder and is deleted with the batch when its persistence discards the run; a file under /files/ is served to anyone with its URL, so the name must not be guessable. The expiry deletes old exports so the file manager does not fill up.
A link, not an attachment: Send mail cannot attach files. One render for a few thousand rows; beyond that, a single template becomes slow and memory-hungry. For a larger export, write the rows in parts from a loop, one file per chunk, and join them with Merge files; chunk sizes are on Scheduled work. If the export must contain only what changed since yesterday, use a watermark rather than a date filter in Retrieve records, which cannot compare dates.