Answers.Body: <p>Sounds like you're looking for <a href="https://github.com/eileenmcnaughton/civicrm_views_token" rel="nofollow noreferrer">CiviCRM Views Token</a>.</p>
  
  <p>This is a Drupal module which allows you to place a token in your CiviMail that will be replaced with the output of a Drupal View.</p>
  
  <p>To use it:</p>
  
  <ul>
  <li>Install and enable CiviCRM Views Token</li>
  <li>Build your view of contacts in Drupal - keep the output simple, eg a table or an unformatted list.</li>
  <li>In your CiviMail edit screen, look for "Configured Drupal View" in the token selector.</li>
  <li>Place the desired view in your email, eg <code>{civicrm_views_tokens.viewcontactlist}</code></li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-07T09:45:57.407Z
Answers.Text: This link from the Fuzion website might be useful too - [Styling Mails & CiviMails in CiviCRM](https://fuzion.co.nz/blogs/styling-mails-civimails-civicrm)
Answers.UserDisplayName: Chris Burgess
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-07T10:38:36.510Z
Answers.Text: Sounds great but can't get it to work yet.  My view is called 'ContactList' so the token in the email is {civicrm_views_tokens.ContactList} but all I get is a blank in the email. The view has paging turned off ('Display all items') and no contextual filters and is a table.  So not sure what to do next.  But I notice the module is 6 years old so wondering if there's been a change in Civi that is stopping it working.
Answers.UserDisplayName: Andy Clark
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-08T12:19:00.587Z
Answers.Text: I asked the author yesterday and she thought it was recently used by someone, but that's all I've got. May be worth noting that if anonymous user or perhaps the user receiving the email can't see that view, it might make sense it won't be displayed during email generation either. No idea how you're testing the email. You can join the community on [CiviCRM Chat](https://chat.civicrm.org) and see if someone can help?
Answers.UserDisplayName: Chris Burgess
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-07T09:44:25.810Z
Answers.LastActivityDate: 2019-10-07T09:44:25.810Z
Answers.UserDisplayName: Chris Burgess
Body: <p>My users want to send an email from Civi that will have a particular group of contacts embedded in it or as an attachment. The group is featured in a report, so emailing the report seems like the solution, but they want to preface the report with some words.  How to embed or attach the contact list or report into an email sent from Civi?  This is using Drupal so perhaps Views is an option?</p>
  
Tags: <drupal><email><civireport><drupal-views>
Title: How to embed or attach a list of contacts in an email?
ThreadText: # How to embed or attach a list of contacts in an email?
  
  (Asked by: username_0 on 2019-10-07)
  
  My users want to send an email from Civi that will have a particular group of contacts embedded in it or as an attachment. The group is featured in a report, so emailing the report seems like the solution, but they want to preface the report with some words. How to embed or attach the contact list or report into an email sent from Civi? This is using Drupal so perhaps Views is an option?
  
  **Tags:** drupal, email, civireport, drupal-views
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-10-07. Score: 1
  
  Sounds like you're looking for [CiviCRM Views Token](https://github.com/eileenmcnaughton/civicrm_views_token).
  
  This is a Drupal module which allows you to place a token in your CiviMail that will be replaced with the output of a Drupal View.
  
  To use it:
  
  * Install and enable CiviCRM Views Token
  * Build your view of contacts in Drupal - keep the output simple, eg a table or an unformatted list.
  * In your CiviMail edit screen, look for "Configured Drupal View" in the token selector.
  * Place the desired view in your email, eg `{civicrm_views_tokens.viewcontactlist}`
  
  > **Comments:**
  > **username_1**: This link from the Fuzion website might be useful too - [Styling Mails & CiviMails in CiviCRM](https://fuzion.co.nz/blogs/styling-mails-civimails-civicrm)  
  > **username_0**: Sounds great but can't get it to work yet.  My view is called 'ContactList' so the token in the email is {civicrm_views_tokens.ContactList} but all I get is a blank in the email. The view has paging turned off ('Display all items') and no contextual filters and is a table.  So not sure what to do next.  But I notice the module is 6 years old so wondering if there's been a change in Civi that is stopping it working.  
  > **username_1**: I asked the author yesterday and she thought it was recently used by someone, but that's all I've got. May be worth noting that if anonymous user or perhaps the user receiving the email can't see that view, it might make sense it won't be displayed during email generation either. No idea how you're testing the email. You can join the community on [CiviCRM Chat](https://chat.civicrm.org) and see if someone can help?  
  
  ---
  
  