I am trying to display in a Drupal (8) view the content of emails that have been sent to contacts using the contact Send Email action. I am using the details field from the activity to show the content. The problem is that the view is outputting the HTML from the email and not rendering it. So it is showing for example <p>Some text here <a href="...">A link</a></p>.

Is there any way I can get it to render the HTML instead of outputting it? The formatter options for the field are only "Default" or "Trimmed". I did try overidding the individual field twig template but couldn't get this to work. I wasn't sure whether it would be possible using this method.

  • Under 'rewrite' you should see an option for 'Strip HTML tags' - does that help? suspect not, but worth mentioning
    – petednz - fuzion
    Apr 19, 2021 at 20:17
  • 1
    Ticking the option for 'Strip HTML tags' makes no difference to the output. The HTML tags are still displayed.
    – Ben
    Apr 21, 2021 at 8:08

1 Answer 1


Drupal is very secure/paranoid when it comes to outputting html/text. I suspect that the views/field integration for the entity (i.e the activity civicrm entity) might need to be updated to allow the html through without any filtering.

  • Thanks for your answer. It seems like quite a complex problem to solve!
    – Ben
    Apr 23, 2021 at 8:22
  • Maybe, but perhaps one of the smarter civi drupal people will see this and have a better clue of where to fix it.
    – Alan Dixon
    Apr 23, 2021 at 20:41

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.