1

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?

1 Answer 1

1

Sounds like you're looking for 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}
3
  • This link from the Fuzion website might be useful too - Styling Mails & CiviMails in CiviCRM Commented Oct 7, 2019 at 9:45
  • 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.
    – Andy Clark
    Commented Oct 7, 2019 at 10:38
  • 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 and see if someone can help? Commented Oct 8, 2019 at 12:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.