Answers.Body: <p>I don't know of a way to do this. When I had a similar need I mail-merged in Word, then generated PDFs with the relevant Contact ID in the filename. I then uploaded all these and used a token to link to the relevant PDF for each contact.</p>
  <p>Not super elegant, but worked. Admittedly I was in a hurry and didn't research fully. Hopefully others may know of something better.</p>
  <p>I think I had to use the <a href="https://answers.microsoft.com/en-us/msoffice/forum/all/downloading-merge-tools-addin/21a5c85b-7bd7-4b45-bc60-f3146ed94c13" rel="nofollow noreferrer">Merge Tools extension</a> to generate the PDFs with merge-fields in the filename.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-11-15T13:44:18.183Z
Answers.LastActivityDate: 2021-11-15T13:44:18.183Z
Answers.UserDisplayName: Andrew West
Answers.Body: <p>I cannot think of a way CiviCRM can do this, basically you are asking the mailing software to open a Word Doc template, insert tokens, save it and then send it onwards. Also your bandwidth is going to be quite high if you are sending attachments out to all.</p>
  <p>In Drupal you could create a Webform template with all of those custom data sets and style it anyway you want. Then you would just need a link in your email to that webform that would autofill the data required.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-11-15T14:44:24.320Z
Answers.LastActivityDate: 2021-11-15T14:44:24.320Z
Answers.UserDisplayName: Barijohn
Body: <p>How can I use tokens in Mass Mail attachements?
  For example, I would like to add .docx or .pdf as attachement that already contains tokens in text and then let CiviCRM replace them for each contact while sending it?</p>
  <p>I know this functionality is implemented in Print/Mail merge, but I don't know if I do it that way, how can I send them via email that created document instead of downloading it to my computer...</p>
  <p>Thank you in advance,
  Aleksandar</p>
  
Tags: <civimail><tokens><attachments><printmerge>
Title: Tokens in Mass Mail Attachements
ThreadText: # Tokens in Mass Mail Attachements
  
  (Asked by: username_0 on 2021-11-12)
  
  How can I use tokens in Mass Mail attachements?
  For example, I would like to add .docx or .pdf as attachement that already contains tokens in text and then let CiviCRM replace them for each contact while sending it?
  
  I know this functionality is implemented in Print/Mail merge, but I don't know if I do it that way, how can I send them via email that created document instead of downloading it to my computer...
  
  Thank you in advance,
  Aleksandar
  
  **Tags:** civimail, tokens, attachments, printmerge
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2021-11-15. Score: 1
  
  I don't know of a way to do this. When I had a similar need I mail-merged in Word, then generated PDFs with the relevant Contact ID in the filename. I then uploaded all these and used a token to link to the relevant PDF for each contact.
  
  Not super elegant, but worked. Admittedly I was in a hurry and didn't research fully. Hopefully others may know of something better.
  
  I think I had to use the [Merge Tools extension](https://answers.microsoft.com/en-us/msoffice/forum/all/downloading-merge-tools-addin/21a5c85b-7bd7-4b45-bc60-f3146ed94c13) to generate the PDFs with merge-fields in the filename.
  
  
  ---
  
  ### Answer by username_2 on 2021-11-15. Score: 0
  
  I cannot think of a way CiviCRM can do this, basically you are asking the mailing software to open a Word Doc template, insert tokens, save it and then send it onwards. Also your bandwidth is going to be quite high if you are sending attachments out to all.
  
  In Drupal you could create a Webform template with all of those custom data sets and style it anyway you want. Then you would just need a link in your email to that webform that would autofill the data required.
  
  
  ---
  
  