Go to invoice settings in the document settings page. Then you need to enable invoice there. After that choose the order status for which invoice to be generated. The invoice and other static files will only attach to order emails of selected status.
For invoice attachment enable attach pdf in email option.
For other static files enable-attach additional documents in the email option.