From a67815dd018202c1f85ad8577c06bad1a9212586 Mon Sep 17 00:00:00 2001 From: Simon Urli Date: Thu, 18 Jan 2024 12:15:28 +0100 Subject: [PATCH] XWIKI-21752: Email notifications events description do not display the user avatar anymore * Use the proper macro for displaying user in email notifications (cherry picked from commit 69fe80c401fc1f542bda61bd2bdf1621f881e9f6) --- .../templates/notification/email/macros.vm | 2 +- .../resources/templates/notification/macros.vm | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-templates/src/main/resources/templates/notification/email/macros.vm b/xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-templates/src/main/resources/templates/notification/email/macros.vm index a0643f0bd74d..224c8525fbdf 100644 --- a/xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-templates/src/main/resources/templates/notification/email/macros.vm +++ b/xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-templates/src/main/resources/templates/notification/email/macros.vm @@ -107,7 +107,7 @@ #end #macro(displayNotificationDescription $event) - #displayCompositeEventDescription($event) + #displayCompositeEventDescription($event true) #end diff --git a/xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-templates/src/main/resources/templates/notification/macros.vm b/xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-templates/src/main/resources/templates/notification/macros.vm index 51dcabf80e31..0481dbb1a52e 100644 --- a/xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-templates/src/main/resources/templates/notification/macros.vm +++ b/xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-templates/src/main/resources/templates/notification/macros.vm @@ -65,7 +65,7 @@ #end
- #displayCompositeEventDescription($compositeEvent) + #displayCompositeEventDescription($compositeEvent false)
$escapetool.xml($services.date.displayTimeAgo($compositeEvent.dates.get(0)))
#end @@ -241,7 +241,7 @@ $xwiki.getPlainUserName($user)## #displayNotificationEventSkeleton($icon, 'comment', $content, '') #end -#macro(displayCompositeEventDescription $compositeEvent) +#macro(displayCompositeEventDescription $compositeEvent $forEmail) #set ($baseTranslationPrefix = "${compositeEvent.type}") #set ($fallbackTranslationPrefix = "notifications.events.${compositeEvent.type}") #set ($fallbackTranslationSuffix = "description") @@ -254,7 +254,11 @@ $xwiki.getPlainUserName($user)## "${baseTranslationPrefix}.${fallbackTranslationSuffix}", "${fallbackTranslationPrefix}.${fallbackTranslationSuffix}" ]) - #set ($translationParameters = ["#displayNotificationEventUsers($compositeEvent.users, true, false)"]) + #if ($forEmail) + #set ($translationParameters = ["#displayEmailNotificationEventUsers($compositeEvent.users, true, false)"]) + #else + #set ($translationParameters = ["#displayNotificationEventUsers($compositeEvent.users, true, false)"]) + #end $services.localization.render($translationKeys,$translationParameters) #else
@@ -269,7 +273,11 @@ $xwiki.getPlainUserName($user)## $services.localization.render($translationKeys,$translationParameters)
- #displayNotificationEventUsers($compositeEvent.users, true, true) + #if ($forEmail) + #displayEmailNotificationEventUsers($compositeEvent.users, true, true) + #else + #displayNotificationEventUsers($compositeEvent.users, true, true) + #end
#end #end \ No newline at end of file