From 28b06a7ebc3ef32bd1961b421c7c0909d4df3024 Mon Sep 17 00:00:00 2001 From: anilgupta Date: Wed, 17 Jan 2024 16:03:26 +0530 Subject: [PATCH 1/4] Issue #LR-676 fix: Support email --- .../src/main/java/org/sunbird/keys/JsonKey.java | 5 +++-- helm/learner/templates/configmap.yaml | 2 +- helm/learner/values.yaml | 1 + .../src/main/java/org/sunbird/util/otp/OTPUtil.java | 10 +++++----- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/core/platform-common/src/main/java/org/sunbird/keys/JsonKey.java b/core/platform-common/src/main/java/org/sunbird/keys/JsonKey.java index 7a07ea0205..f5244557cb 100644 --- a/core/platform-common/src/main/java/org/sunbird/keys/JsonKey.java +++ b/core/platform-common/src/main/java/org/sunbird/keys/JsonKey.java @@ -340,8 +340,8 @@ public final class JsonKey { public static final String EDIT = "edit"; public static final String DEFAULT_FRAMEWORK = "defaultFramework"; public static final String EXTERNAL_ID_PROVIDER = "externalIdProvider"; - public static final String SUNBIRD_INSTALLATION_DISPLAY_NAME = - "sunbird_installation_display_name_for_sms"; + public static final String SUNBIRD_INSTALLATION_DISPLAY_NAME = "sunbird_installation_display_name_for_sms"; + public static final String SUNBIRD_SUPPORT_EMAIL = "sunbird_support_email"; public static final String USR_EXT_IDNT_TABLE = "usr_external_identity"; public static final String RESPONSE_CODE = "responseCode"; public static final String OK = "ok"; @@ -406,6 +406,7 @@ public final class JsonKey { public static final String RATE_LIMIT_UNIT = "unit"; public static final String RATE = "rate"; public static final String INSTALLATION_NAME = "installationName"; + public static final String SUPPORT_EMAIL = "supportEmail"; public static final String LOCATION_CODES = "locationCodes"; public static final String USER_LOCATIONS = "userLocations"; public static final String USER_ID_TYPE = "userIdType"; diff --git a/helm/learner/templates/configmap.yaml b/helm/learner/templates/configmap.yaml index f39a2e88c4..8fdf3d5a85 100644 --- a/helm/learner/templates/configmap.yaml +++ b/helm/learner/templates/configmap.yaml @@ -261,7 +261,7 @@ data: telemetry_pdata_pid: {{ .Values.telemetry_pdata_pid }} telemetry_queue_threshold_value: {{ .Values.telemetry_queue_threshold_value | quote }} user_index_alias: {{ .Values.user_index_alias }} - + sunbird_support_email: {{ .Values.sunbird_support_email }} --- apiVersion: v1 kind: ConfigMap diff --git a/helm/learner/values.yaml b/helm/learner/values.yaml index 32d03df656..dd7ac6829f 100644 --- a/helm/learner/values.yaml +++ b/helm/learner/values.yaml @@ -140,6 +140,7 @@ telemetry_pdata_id: learner telemetry_pdata_pid: learner-service telemetry_queue_threshold_value: 100 user_index_alias: user_alias +sunbird_support_email: support@sunbird.org ## Variables that can be deprecated diff --git a/service/src/main/java/org/sunbird/util/otp/OTPUtil.java b/service/src/main/java/org/sunbird/util/otp/OTPUtil.java index eadbd82694..fc1c87c6ad 100644 --- a/service/src/main/java/org/sunbird/util/otp/OTPUtil.java +++ b/service/src/main/java/org/sunbird/util/otp/OTPUtil.java @@ -84,11 +84,9 @@ public static boolean sendOTPViaSMS(Map otpMap, RequestContext c Map smsTemplate = new HashMap<>(); String templateId = (String) otpMap.get(JsonKey.TEMPLATE_ID); smsTemplate.put(JsonKey.OTP, (String) otpMap.get(JsonKey.OTP)); - smsTemplate.put( - JsonKey.OTP_EXPIRATION_IN_MINUTES, (String) otpMap.get(JsonKey.OTP_EXPIRATION_IN_MINUTES)); - smsTemplate.put( - JsonKey.INSTALLATION_NAME, - ProjectUtil.getConfigValue(JsonKey.SUNBIRD_INSTALLATION_DISPLAY_NAME)); + smsTemplate.put(JsonKey.OTP_EXPIRATION_IN_MINUTES, (String) otpMap.get(JsonKey.OTP_EXPIRATION_IN_MINUTES)); + smsTemplate.put(JsonKey.INSTALLATION_NAME, ProjectUtil.getConfigValue(JsonKey.SUNBIRD_INSTALLATION_DISPLAY_NAME)); + smsTemplate.put(JsonKey.SUPPORT_EMAIL, ProjectUtil.getConfigValue(JsonKey.SUNBIRD_SUPPORT_EMAIL)); String sms = ""; if (StringUtils.isBlank(templateId)) { sms = otpService.getSmsBody(JsonKey.VERIFY_PHONE_OTP_TEMPLATE, smsTemplate, context); @@ -138,6 +136,7 @@ public static Request getRequestToSendOTPViaEmail( } String templateId = (String) emailTemplateMap.get(JsonKey.TEMPLATE_ID); String envName = ProjectUtil.getConfigValue(JsonKey.SUNBIRD_INSTALLATION_DISPLAY_NAME); + String supportEmail = ProjectUtil.getConfigValue(JsonKey.SUNBIRD_SUPPORT_EMAIL); List reciptientsMail = new ArrayList<>(); reciptientsMail.add((String) emailTemplateMap.get(JsonKey.EMAIL)); emailTemplateMap.put(JsonKey.RECIPIENT_EMAILS, reciptientsMail); @@ -160,6 +159,7 @@ public static Request getRequestToSendOTPViaEmail( emailTemplateMap.put(JsonKey.SUBJECT, JsonKey.DELETE_USER_VERIFICATION_SUBJECT); } emailTemplateMap.put(JsonKey.INSTALLATION_NAME, envName); + emailTemplateMap.put(JsonKey.SUPPORT_EMAIL, supportEmail); request = new Request(); request.setOperation(ActorOperations.EMAIL_SERVICE.getValue()); request.put(JsonKey.EMAIL_REQUEST, emailTemplateMap); From 62c7a58d353b9eca6e1a4969913a110bc2ebd5aa Mon Sep 17 00:00:00 2001 From: anilgupta Date: Thu, 18 Jan 2024 12:17:50 +0530 Subject: [PATCH 2/4] Issue #LR-676 fix: sonar java version fix --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 62ff1e9373..1188c33027 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,6 +3,8 @@ jobs: build: machine: image: ubuntu-2004:202008-01 + docker: + - image: circleci/openjdk:17-jdk-buster-node-browsers-legacy steps: - checkout - restore_cache: From f00697747b54c3146467d4261f6df35fea5bb7ad Mon Sep 17 00:00:00 2001 From: anilgupta Date: Thu, 18 Jan 2024 12:23:27 +0530 Subject: [PATCH 3/4] Issue #LR-676 fix: sonar java version fix --- .circleci/config.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1188c33027..8f283612c3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,8 +1,7 @@ version: 2.1 +executorType: machine jobs: build: - machine: - image: ubuntu-2004:202008-01 docker: - image: circleci/openjdk:17-jdk-buster-node-browsers-legacy steps: From b0a0414cac064fafd442e861d0ccecd063d0c201 Mon Sep 17 00:00:00 2001 From: anilgupta Date: Thu, 18 Jan 2024 12:25:38 +0530 Subject: [PATCH 4/4] Issue #LR-676 fix: sonar java version fix --- .circleci/config.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8f283612c3..62ff1e9373 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,9 +1,8 @@ version: 2.1 -executorType: machine jobs: build: - docker: - - image: circleci/openjdk:17-jdk-buster-node-browsers-legacy + machine: + image: ubuntu-2004:202008-01 steps: - checkout - restore_cache: