Build your document in Word. To personalize it, insert meta-tags from the form attached to the program, i.e. meta-tags built in ${...}. The file sent will be in .docx format.
Create a document yourself in your platform using the different text editors (message body, header, footer). To personalize it, use general meta tags and form meta tags. The file is sent as PDF.