function template_preprocess_easy_email_body_plain in Easy Email 8
Same name and namespace in other branches
- 2.0.x easy_email.module \template_preprocess_easy_email_body_plain()
File
- ./
easy_email.module, line 158 - Contains easy_email.module.
Code
function template_preprocess_easy_email_body_plain(array &$variables) {
/** @var \Drupal\easy_email\Entity\EasyEmailInterface $email */
$email = $variables['easy_email'];
$plain_body = $email
->getPlainBody();
if (!empty($plain_body)) {
$variables['body'] = [
'#markup' => Xss::filter($plain_body, []),
];
}
}