From 64a8daca86ab7e68d307554b54431760a9b5748b Mon Sep 17 00:00:00 2001 From: Ayoub Zayati Date: Mon, 7 Oct 2024 14:41:20 +0200 Subject: [PATCH] feat: Send published article public link in publish news mail notification message - EXO-73050 - Meeds-io/MIPs#129 (#250) --- .../meeds/news/notification/provider/MailTemplateProvider.java | 3 +-- .../news/notification/provider/MailTemplateProviderTest.java | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/content-service/src/main/java/io/meeds/news/notification/provider/MailTemplateProvider.java b/content-service/src/main/java/io/meeds/news/notification/provider/MailTemplateProvider.java index 1f80c1ec1..ba3c331a6 100644 --- a/content-service/src/main/java/io/meeds/news/notification/provider/MailTemplateProvider.java +++ b/content-service/src/main/java/io/meeds/news/notification/provider/MailTemplateProvider.java @@ -111,8 +111,7 @@ protected MessageInfo makeMessage(NotificationContext ctx) { templateContext.put("AUTHOR_AVATAR_URL", encoder.encode(authorAvatarUrl)); templateContext.put("CONTEXT", encoder.encode(context)); StringBuilder activityUrl = new StringBuilder(); - Space space = spaceService.getSpaceByDisplayName(contentSpaceName); - if (pluginId.equals(PublishNewsNotificationPlugin.ID) && !spaceService.isMember(space, notification.getTo())) { + if (pluginId.equals(PublishNewsNotificationPlugin.ID)) { String portalName = PortalContainer.getCurrentPortalContainerName(); String portalOwner = CommonsUtils.getCurrentPortalOwner(); String currentDomain = CommonsUtils.getCurrentDomain(); diff --git a/content-service/src/test/java/io/meeds/news/notification/provider/MailTemplateProviderTest.java b/content-service/src/test/java/io/meeds/news/notification/provider/MailTemplateProviderTest.java index 62edf4edf..4dbcff7b3 100644 --- a/content-service/src/test/java/io/meeds/news/notification/provider/MailTemplateProviderTest.java +++ b/content-service/src/test/java/io/meeds/news/notification/provider/MailTemplateProviderTest.java @@ -153,7 +153,6 @@ public void shouldInstantiateMailTemplate() { when(encoder.encode("jean")).thenReturn("jean"); when(encoder.encode("http://localhost:8080/content/images/newsImageDefault.png")).thenReturn("http://localhost:8080/content/images/newsImageDefault.png"); when(encoder.encode("COMMENT MY NEWS")).thenReturn("COMMENT MY NEWS"); - when(encoder.encode("http://localhost:8080/portal/intranet/activity?id=39")).thenReturn("http://localhost:8080/portal/intranet/activity?id=39"); when(notification.getValueOwnerParameter("read")).thenReturn("true"); when(notification.getId()).thenReturn("NotifId123"); Date date = new Date();