From a97a7cf80ddbb0fc0bc48b8f69f2162af265d451 Mon Sep 17 00:00:00 2001 From: Valentin Yanakiev Date: Wed, 14 Dec 2022 16:06:31 +0200 Subject: [PATCH] Fixed wrong email payload for user removal --- .gitignore | 1 + service/package-lock.json | 4 ++-- service/package.json | 2 +- .../platform.user.removed.notification.builder.ts | 11 ++--------- 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index 6e43c265..8da22b83 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ /docs/diagrams/.$* /service/coverage/* /service/coverage-ci/* +/node_modules/* *.log .env diff --git a/service/package-lock.json b/service/package-lock.json index 0d9278f8..e7ae61c2 100644 --- a/service/package-lock.json +++ b/service/package-lock.json @@ -1,12 +1,12 @@ { "name": "alkemio-notifications", - "version": "0.6.1", + "version": "0.6.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "alkemio-notifications", - "version": "0.6.1", + "version": "0.6.2", "license": "EUPL-1.2", "dependencies": { "@alkemio/client-lib": "^0.17.2", diff --git a/service/package.json b/service/package.json index a9ad5275..afe574dc 100644 --- a/service/package.json +++ b/service/package.json @@ -1,6 +1,6 @@ { "name": "alkemio-notifications", - "version": "0.6.1", + "version": "0.6.2", "description": "Alkemio notifications service", "author": "Alkemio Foundation", "private": false, diff --git a/service/src/services/domain/builders/platform-user-removed/platform.user.removed.notification.builder.ts b/service/src/services/domain/builders/platform-user-removed/platform.user.removed.notification.builder.ts index 966173fd..a06db6ad 100644 --- a/service/src/services/domain/builders/platform-user-removed/platform.user.removed.notification.builder.ts +++ b/service/src/services/domain/builders/platform-user-removed/platform.user.removed.notification.builder.ts @@ -51,15 +51,8 @@ export class PlatformUserRemovedNotificationBuilder private createTemplatePayload( eventPayload: PlatformUserRemovedEventPayload, - recipient: User, - registrant?: User + recipient: User ): PlatformUserRemovedEmailPayload { - if (!registrant) { - throw Error( - `Registrant not provided for '${NotificationEventType.PLATFORM_USER_REMOVED}' event` - ); - } - const notificationPreferenceURL = this.alkemioUrlGenerator.createUserNotificationPreferencesURL( recipient.nameID @@ -68,7 +61,7 @@ export class PlatformUserRemovedNotificationBuilder emailFrom: 'info@alkem.io', registrant: { displayName: eventPayload.user.displayName, - email: registrant.email, + email: eventPayload.user.email, }, recipient: { firstName: recipient.firstName,