move inside the `if`? When there are no attachments, there is no need to include the file