Skip to content

Commit

Permalink
Issue #LR-676 feat: Delete user Notification
Browse files Browse the repository at this point in the history
  • Loading branch information
Jayaprakash8887 authored and Jayaprakash8887 committed Nov 21, 2023
1 parent f6ed7db commit 96b5858
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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";
Expand Down
5 changes: 5 additions & 0 deletions service/src/main/java/org/sunbird/util/otp/OTPUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ public static boolean sendOTPViaSMS(Map<String, Object> 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);

Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 96b5858

Please sign in to comment.