diff --git a/controller/app/controllers/otp/validator/OtpRequestValidator.java b/controller/app/controllers/otp/validator/OtpRequestValidator.java index 98851d23b5..d83ac01e31 100644 --- a/controller/app/controllers/otp/validator/OtpRequestValidator.java +++ b/controller/app/controllers/otp/validator/OtpRequestValidator.java @@ -21,7 +21,7 @@ public class OtpRequestValidator extends BaseRequestValidator { JsonKey.RESET_PASSWORD_TEMPLATE_ID, JsonKey.WARD_LOGIN_OTP_TEMPLATE_ID, JsonKey.CONTACT_UPDATE_TEMPLATE_ID, - JsonKey.OTP_DELETE_USER_EMAIL_TEMPLATE); + JsonKey.OTP_DELETE_USER_TEMPLATE_ID); public void validateGenerateOtpRequest(Request otpRequest) { commonValidation(otpRequest, false); 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 4b09cfa813..0d9b137b3e 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 @@ -187,6 +187,7 @@ public final class JsonKey { public static final String OTP_PHONE_RESET_PASSWORD_TEMPLATE = "otpPhoneResetPasswordTemplate"; public static final String VERIFY_PHONE_OTP_TEMPLATE = "verifyPhoneOtpTemplate"; public static final String OTP_DELETE_USER_EMAIL_TEMPLATE = "otpEmailDeleteUserTemplate"; + public static final String OTP_DELETE_USER_TEMPLATE_ID = "otpDeleteUserTemplate"; public static final String PARAMS = "params"; public static final String PASSWORD = "password"; @@ -610,8 +611,11 @@ public final class JsonKey { public static final String CONTACT_UPDATE_TEMPLATE_ID = "otpContactUpdateTemplate"; public static final String OTP_CONTACT_UPDATE_TEMPLATE_EMAIL = "otpContactUpdateTemplateEmail"; public static final String OTP_CONTACT_UPDATE_TEMPLATE_SMS = "otpContactUpdateTemplateSms"; + public static final String OTP_DELETE_USER_TEMPLATE_SMS = "otpDeleteUserTemplateSms"; public static final String CONTACT_DETAILS_UPDATE_VERIFICATION_SUBJECT = "OTP to edit Diksha Profile"; + public static final String DELETE_USER_VERIFICATION_SUBJECT = + "OTP to proceed with profile deletion."; public static final String X_Source = "x-source"; public static final String IDS = "ids"; public static final String NOTIFICATIONS = "notifications"; @@ -650,7 +654,7 @@ public final class JsonKey { public static final String JOB = "job"; public static final String USER_PRIVATE_FIELDS = "userPrivateFields"; - //Release 5.4.0 LR-102 + // Release 5.4.0 LR-102 public static final String SUNBIRD_KEYSPACE = "sunbird_userorg_keyspace"; public static final String ES_LOCATION_INDEX = "es_location_index"; public static final String ES_USER_FEED_INDEX = "es_user_feed_index"; 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 5cc8f5850d..eadbd82694 100644 --- a/service/src/main/java/org/sunbird/util/otp/OTPUtil.java +++ b/service/src/main/java/org/sunbird/util/otp/OTPUtil.java @@ -98,6 +98,8 @@ public static boolean sendOTPViaSMS(Map otpMap, RequestContext c sms = otpService.getSmsBody(JsonKey.OTP_PHONE_RESET_PASSWORD_TEMPLATE, smsTemplate, context); } else if (StringUtils.equals(JsonKey.CONTACT_UPDATE_TEMPLATE_ID, templateId)) { sms = otpService.getSmsBody(JsonKey.OTP_CONTACT_UPDATE_TEMPLATE_SMS, smsTemplate, context); + } else if (StringUtils.equals(JsonKey.OTP_DELETE_USER_TEMPLATE_ID, templateId)) { + sms = otpService.getSmsBody(JsonKey.OTP_DELETE_USER_TEMPLATE_SMS, smsTemplate, context); } logger.debug(context, "OTPUtil:sendOTPViaSMS: SMS text = " + sms); @@ -153,6 +155,9 @@ public static Request getRequestToSendOTPViaEmail( } else if (StringUtils.equalsIgnoreCase(JsonKey.CONTACT_UPDATE_TEMPLATE_ID, templateId)) { emailTemplateMap.put(JsonKey.EMAIL_TEMPLATE_TYPE, JsonKey.OTP_CONTACT_UPDATE_TEMPLATE_EMAIL); emailTemplateMap.put(JsonKey.SUBJECT, JsonKey.CONTACT_DETAILS_UPDATE_VERIFICATION_SUBJECT); + } else if (StringUtils.equalsIgnoreCase(JsonKey.OTP_DELETE_USER_TEMPLATE_ID, templateId)) { + emailTemplateMap.put(JsonKey.EMAIL_TEMPLATE_TYPE, JsonKey.OTP_DELETE_USER_EMAIL_TEMPLATE); + emailTemplateMap.put(JsonKey.SUBJECT, JsonKey.DELETE_USER_VERIFICATION_SUBJECT); } emailTemplateMap.put(JsonKey.INSTALLATION_NAME, envName); request = new Request();