From 12056096f24059d154b90a57793d3324d50b5e7d Mon Sep 17 00:00:00 2001 From: Valentin Yanakiev Date: Fri, 10 Dec 2021 17:40:58 +0200 Subject: [PATCH 1/5] User preferences --- package-lock.json | 14 +++---- package.json | 2 +- ...discussion.created.notification.builder.ts | 3 +- ...munication.updated.notification.builder.ts | 3 +- .../_layouts/email-transactional.html | 42 ++++--------------- src/templates/user.application.applicant.js | 15 +++++++ 6 files changed, 36 insertions(+), 43 deletions(-) diff --git a/package-lock.json b/package-lock.json index fb028582..c6984282 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "0.4.3", "license": "EUPL-1.2", "dependencies": { - "@alkemio/client-lib": "^0.10.2", + "@alkemio/client-lib": "^0.10.4", "@nestjs/axios": "^0.0.1", "@nestjs/common": "^8.0.5", "@nestjs/config": "^1.0.1", @@ -74,9 +74,9 @@ } }, "node_modules/@alkemio/client-lib": { - "version": "0.10.2", - "resolved": "https://registry.npmjs.org/@alkemio/client-lib/-/client-lib-0.10.2.tgz", - "integrity": "sha512-JZNslgaGIIc2FlsIvET5x/JHGtq05y8MpVhUJj8U3ivjentCaHEApSGwl1i4/2yHwbvY7TbHYDga/dzDcc6hzA==", + "version": "0.10.4", + "resolved": "https://registry.npmjs.org/@alkemio/client-lib/-/client-lib-0.10.4.tgz", + "integrity": "sha512-XWVIgcBMDRtR4n955rs/trdw+kZE2Zs4yhXcaVdr2o1l78lqyccDdlKhGcf4L3OLDDdVm9aQOpUUckkeX+fiSQ==", "dependencies": { "axios": "^0.21.1", "dotenv": "^8.2.0", @@ -17355,9 +17355,9 @@ }, "dependencies": { "@alkemio/client-lib": { - "version": "0.10.2", - "resolved": "https://registry.npmjs.org/@alkemio/client-lib/-/client-lib-0.10.2.tgz", - "integrity": "sha512-JZNslgaGIIc2FlsIvET5x/JHGtq05y8MpVhUJj8U3ivjentCaHEApSGwl1i4/2yHwbvY7TbHYDga/dzDcc6hzA==", + "version": "0.10.4", + "resolved": "https://registry.npmjs.org/@alkemio/client-lib/-/client-lib-0.10.4.tgz", + "integrity": "sha512-XWVIgcBMDRtR4n955rs/trdw+kZE2Zs4yhXcaVdr2o1l78lqyccDdlKhGcf4L3OLDDdVm9aQOpUUckkeX+fiSQ==", "requires": { "axios": "^0.21.1", "dotenv": "^8.2.0", diff --git a/package.json b/package.json index 5cd04617..720fb629 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "validate-connection": "ts-node src/utils/validate-connection.ts" }, "dependencies": { - "@alkemio/client-lib": "^0.10.2", + "@alkemio/client-lib": "^0.10.4", "@nestjs/axios": "^0.0.1", "@nestjs/common": "^8.0.5", "@nestjs/config": "^1.0.1", diff --git a/src/services/domain/builders/communication-discussion-created/communication.discussion.created.notification.builder.ts b/src/services/domain/builders/communication-discussion-created/communication.discussion.created.notification.builder.ts index 22007349..5e654782 100644 --- a/src/services/domain/builders/communication-discussion-created/communication.discussion.created.notification.builder.ts +++ b/src/services/domain/builders/communication-discussion-created/communication.discussion.created.notification.builder.ts @@ -57,7 +57,8 @@ export class CommunicationDiscussionCreatedNotificationBuilder { eventPayload, 'admin', EmailTemplate.COMMUNICATION_DISCUSSION_CREATED_ADMIN, - sender + sender, + UserPreferenceType.NotificationCommunicationDiscussionCreatedAdmin ); const memberNotificationPromises = await this.buildNotificationsForRole( diff --git a/src/services/domain/builders/communication-updated/communication.updated.notification.builder.ts b/src/services/domain/builders/communication-updated/communication.updated.notification.builder.ts index ddfa3a89..0d9d5c90 100644 --- a/src/services/domain/builders/communication-updated/communication.updated.notification.builder.ts +++ b/src/services/domain/builders/communication-updated/communication.updated.notification.builder.ts @@ -53,7 +53,8 @@ export class CommunicationUpdateNotificationBuilder { eventPayload, 'admin', EmailTemplate.COMMUNICATION_UPDATE_ADMIN, - sender + sender, + UserPreferenceType.NotificationCommunicationUpdateSentAdmin ); const memberNotificationPromises = await this.buildNotificationsForRole( diff --git a/src/templates/_layouts/email-transactional.html b/src/templates/_layouts/email-transactional.html index 7b6fc973..fce043d0 100644 --- a/src/templates/_layouts/email-transactional.html +++ b/src/templates/_layouts/email-transactional.html @@ -5,6 +5,10 @@ + + + - +
-
+
- +
- -
@@ -188,14 +182,6 @@ padding: 10px 25px; " > -