Check has_file when sending order emails for downloadables

Fixes #5296
Allow saving no downloads, if unset

#5296
Let get_file get the first file if no ID is defined

#5296