From cd887332864ef9c461f300abdd421dd8c2c40428 Mon Sep 17 00:00:00 2001 From: Aleksandar Date: Mon, 25 Sep 2023 13:00:55 +0200 Subject: [PATCH 1/3] Fix recipients for new post created notification. --- ...laboration.post.created.notification.builder.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/service/src/services/domain/builders/collaboration-post-created/collaboration.post.created.notification.builder.ts b/service/src/services/domain/builders/collaboration-post-created/collaboration.post.created.notification.builder.ts index a44b6584..2959819f 100644 --- a/service/src/services/domain/builders/collaboration-post-created/collaboration.post.created.notification.builder.ts +++ b/service/src/services/domain/builders/collaboration-post-created/collaboration.post.created.notification.builder.ts @@ -42,9 +42,19 @@ export class CollaborationPostCreatedNotificationBuilder }, ]; + const spaceIDTemplateVar = + !payload.journey?.challenge?.opportunity?.id && + !payload.journey?.challenge?.id + ? payload.journey.spaceID + : ''; + + const challengeIDTemplateVar = !payload.journey?.challenge?.opportunity?.id + ? payload.journey?.challenge?.id + : undefined; + const templateVariables = { - spaceID: payload.journey.spaceID, - challengeID: payload.journey?.challenge?.id ?? '', + spaceID: spaceIDTemplateVar, + challengeID: challengeIDTemplateVar ?? '', opportunityID: payload.journey?.challenge?.opportunity?.id ?? '', journeyID: payload.journey?.challenge?.opportunity?.id ?? From 867983d2082c678b316857ea50063fa57439dcbe Mon Sep 17 00:00:00 2001 From: Aleksandar Date: Mon, 25 Sep 2023 13:11:19 +0200 Subject: [PATCH 2/3] Fix recipients lists of other notifications. --- ...tion.whiteboard.created.notification.builder.ts | 14 ++++++++++++-- ...ity.application.created.notification.builder.ts | 13 +++++++++++-- .../community.new.member.notification.builder.ts | 14 ++++++++++++-- 3 files changed, 35 insertions(+), 6 deletions(-) diff --git a/service/src/services/domain/builders/collaboration-whiteboard-created/collaboration.whiteboard.created.notification.builder.ts b/service/src/services/domain/builders/collaboration-whiteboard-created/collaboration.whiteboard.created.notification.builder.ts index 72085c58..b3359a71 100644 --- a/service/src/services/domain/builders/collaboration-whiteboard-created/collaboration.whiteboard.created.notification.builder.ts +++ b/service/src/services/domain/builders/collaboration-whiteboard-created/collaboration.whiteboard.created.notification.builder.ts @@ -42,9 +42,19 @@ export class CollaborationWhiteboardCreatedNotificationBuilder }, ]; + const spaceIDTemplateVar = + !payload.journey?.challenge?.opportunity?.id && + !payload.journey?.challenge?.id + ? payload.journey.spaceID + : ''; + + const challengeIDTemplateVar = !payload.journey?.challenge?.opportunity?.id + ? payload.journey?.challenge?.id + : undefined; + const templateVariables = { - spaceID: payload.journey.spaceID, - challengeID: payload.journey?.challenge?.id ?? '', + spaceID: spaceIDTemplateVar, + challengeID: challengeIDTemplateVar ?? '', opportunityID: payload.journey?.challenge?.opportunity?.id ?? '', journeyID: payload.journey?.challenge?.opportunity?.id ?? diff --git a/service/src/services/domain/builders/community-application-created/community.application.created.notification.builder.ts b/service/src/services/domain/builders/community-application-created/community.application.created.notification.builder.ts index 0f5dfee6..e83ce660 100644 --- a/service/src/services/domain/builders/community-application-created/community.application.created.notification.builder.ts +++ b/service/src/services/domain/builders/community-application-created/community.application.created.notification.builder.ts @@ -42,11 +42,20 @@ export class CommunityApplicationCreatedNotificationBuilder preferenceType: UserPreferenceType.NotificationApplicationSubmitted, }, ]; + const spaceIDTemplateVar = + !payload.journey?.challenge?.opportunity?.id && + !payload.journey?.challenge?.id + ? payload.journey.spaceID + : ''; + + const challengeIDTemplateVar = !payload.journey?.challenge?.opportunity?.id + ? payload.journey?.challenge?.id + : undefined; const templateVariables = { applicantID: payload.applicantID, - spaceID: payload.journey.spaceID, - challengeID: payload.journey.challenge?.id ?? '', + spaceID: spaceIDTemplateVar, + challengeID: challengeIDTemplateVar ?? '', opportunityID: payload.journey.challenge?.opportunity?.id ?? '', }; diff --git a/service/src/services/domain/builders/community-new-member/community.new.member.notification.builder.ts b/service/src/services/domain/builders/community-new-member/community.new.member.notification.builder.ts index 21fa8ed7..3c07fa3e 100644 --- a/service/src/services/domain/builders/community-new-member/community.new.member.notification.builder.ts +++ b/service/src/services/domain/builders/community-new-member/community.new.member.notification.builder.ts @@ -43,10 +43,20 @@ export class CommunityNewMemberNotificationBuilder }, ]; + const spaceIDTemplateVar = + !payload.journey?.challenge?.opportunity?.id && + !payload.journey?.challenge?.id + ? payload.journey.spaceID + : ''; + + const challengeIDTemplateVar = !payload.journey?.challenge?.opportunity?.id + ? payload.journey?.challenge?.id + : undefined; + const templateVariables = { memberID: payload.userID, - spaceID: payload.journey.spaceID, - challengeID: payload.journey.challenge?.id ?? '', + spaceID: spaceIDTemplateVar, + challengeID: challengeIDTemplateVar ?? '', opportunityID: payload.journey.challenge?.opportunity?.id ?? '', }; From 756cbc5df6a16b8671b217c6a59d42209fdd2acf Mon Sep 17 00:00:00 2001 From: Valentin Yanakiev Date: Wed, 27 Sep 2023 10:25:14 +0300 Subject: [PATCH 3/3] Minor version bump (#262) --- service/package-lock.json | 4 ++-- service/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/service/package-lock.json b/service/package-lock.json index 5eba6292..ce2dec40 100644 --- a/service/package-lock.json +++ b/service/package-lock.json @@ -1,12 +1,12 @@ { "name": "alkemio-notifications", - "version": "0.14.2", + "version": "0.14.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "alkemio-notifications", - "version": "0.14.2", + "version": "0.14.3", "license": "EUPL-1.2", "dependencies": { "@alkemio/client-lib": "^0.23.0", diff --git a/service/package.json b/service/package.json index 2cdd26d3..2136ce0c 100644 --- a/service/package.json +++ b/service/package.json @@ -1,6 +1,6 @@ { "name": "alkemio-notifications", - "version": "0.14.2", + "version": "0.14.3", "description": "Alkemio notifications service", "author": "Alkemio Foundation", "private": false,