From 794a31d6b224e25ceffa405dc04b7f68b3d03daf Mon Sep 17 00:00:00 2001
From: Alex Pott <alex.a.pott@googlemail.com>
Date: Thu, 8 Jan 2015 13:52:06 +0000
Subject: [PATCH] Issue #2397607 by Berdir: contact_mail() should use
 renderPlain()

---
 core/modules/contact/contact.module | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/core/modules/contact/contact.module b/core/modules/contact/contact.module
index 0ad6093332f5..99ac31fa52fd 100644
--- a/core/modules/contact/contact.module
+++ b/core/modules/contact/contact.module
@@ -115,7 +115,7 @@ function contact_mail($key, &$message, $params) {
       $message['subject'] .= t('[!form] !subject', $variables, $options);
       $message['body'][] = t("!sender-name (!sender-url) sent a message using the contact form at !form-url.", $variables, $options);
       $build = entity_view($contact_message, 'mail', $language->getId());
-      $message['body'][] = drupal_render_root($build);
+      $message['body'][] = \Drupal::service('renderer')->renderPlain($build);
       break;
 
     case 'page_autoreply':
@@ -134,7 +134,7 @@ function contact_mail($key, &$message, $params) {
       $message['body'][] = t("!sender-name (!sender-url) has sent you a message via your contact form at !site-name.", $variables, $options);
       $message['body'][] = t("If you don't want to receive such emails, you can change your settings at !recipient-edit-url.", $variables, $options);
       $build = entity_view($contact_message, 'mail', $language->getId());
-      $message['body'][] = drupal_render_root($build);
+      $message['body'][] = \Drupal::service('renderer')->renderPlain($build);
       break;
   }
 }
-- 
GitLab