Skip to content

Commit

Permalink
XWIKI-21752: Email notifications events description do not display th…
Browse files Browse the repository at this point in the history
…e user avatar anymore

  * Use the proper macro for displaying user in email notifications

(cherry picked from commit 69fe80c)
  • Loading branch information
surli committed Jan 18, 2024
1 parent 0353732 commit a67815d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
#end

#macro(displayNotificationDescription $event)
#displayCompositeEventDescription($event)
#displayCompositeEventDescription($event true)
#end


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
#end
</div>
<div class="notification-description">
#displayCompositeEventDescription($compositeEvent)
#displayCompositeEventDescription($compositeEvent false)
<div><small class="text-muted">$escapetool.xml($services.date.displayTimeAgo($compositeEvent.dates.get(0)))</small></div>
</div>
#end
Expand Down Expand Up @@ -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")
Expand All @@ -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
<div>
Expand All @@ -269,7 +273,11 @@ $xwiki.getPlainUserName($user)##
$services.localization.render($translationKeys,$translationParameters)
</div>
<div>
#displayNotificationEventUsers($compositeEvent.users, true, true)
#if ($forEmail)
#displayEmailNotificationEventUsers($compositeEvent.users, true, true)
#else
#displayNotificationEventUsers($compositeEvent.users, true, true)
#end
</div>
#end
#end

0 comments on commit a67815d

Please sign in to comment.