Send merged documents as attachments

Send merged documents as attachments

Hello everyone, 

Is there a way to create documents that will have fields from the CRM record and send them as attachments through the CRM function "Send email"? Templates in settings could be created only for the email itself, not for the attached files. And I also tried merging templates in Writer, but the fact of sending this merged template isn't shown in the CRM record. 

Example: 
I need to choose all records with tag X and send the letter (invitation) as an attached file. I want to make this file more personal, so I add there the field with the customer name and some data from custom fields like the name of their boss.