From 62879244e1130eab91bf37c1e0b3d482d1f7a87e Mon Sep 17 00:00:00 2001 From: bach Date: Fri, 6 May 2022 00:41:47 +0200 Subject: [PATCH] fixed readonline linnk in simplenews template --- .../custom/materiotheme/materiotheme.theme | 17 +++++++++++++++++ .../email--simplenews-newsletter.html.twig | 8 +++++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/web/themes/custom/materiotheme/materiotheme.theme b/web/themes/custom/materiotheme/materiotheme.theme index 117156da..427dd612 100644 --- a/web/themes/custom/materiotheme/materiotheme.theme +++ b/web/themes/custom/materiotheme/materiotheme.theme @@ -187,6 +187,23 @@ function materiotheme_preprocess_page(&$vars){ } + +/** + * Prepares variables for email template. + * + * Default template: email.html.twig. + * + * @param array $variables + * An associative array containing: + * - email: An associative array containing the Email object. + */ +function materiotheme_preprocess_email(&$variables) { + $email = $variables['email']; + $variables['body'] = $email->getBody(); + $variables = array_merge($variables, $email->getVariables()); +} + + // function materiotheme_preprocess_node(&$vars){ // $node = $vars['elements']['#node']; // $options = ['absolute' => TRUE]; diff --git a/web/themes/custom/materiotheme/templates/email--simplenews-newsletter.html.twig b/web/themes/custom/materiotheme/templates/email--simplenews-newsletter.html.twig index 0a9b758e..b6a894ff 100644 --- a/web/themes/custom/materiotheme/templates/email--simplenews-newsletter.html.twig +++ b/web/themes/custom/materiotheme/templates/email--simplenews-newsletter.html.twig @@ -1,16 +1,18 @@ - +{# dump() #} +{# devel_breakpoint() #} +{# dump(_context|keys) #} +{# dump(content_attributes) #}
-

Voir la version en ligne / View this email on the web +

Voir la version en ligne / View this email on the web
- {#

{{ title }}

#} {{ body }}