Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Commit

Permalink
PFM-5810 added flag isSMSForUserCreationEnable at time of sending sms…
Browse files Browse the repository at this point in the history
… to users.
  • Loading branch information
Saloni-eGov committed Mar 7, 2024
1 parent c8c0abf commit 482d8a5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,7 @@ public class PropertiesManager {

@Value("${state.level.tenant.id}")
public String stateLevelTenantId;

@Value("${sms.user.creation.enabled}")
public boolean isSMSForUserCreationEnable;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import org.apache.commons.lang3.StringUtils;
import org.egov.common.contract.request.RequestInfo;
import org.egov.hrms.config.PropertiesManager;
import org.egov.hrms.model.Employee;
import org.egov.hrms.model.SMSRequest;
import org.egov.hrms.producer.HRMSProducer;
Expand Down Expand Up @@ -35,6 +36,9 @@ public class NotificationService {
@Autowired
private RestTemplate restTemplate;

@Autowired
private PropertiesManager propertiesManager;

@Value("${kafka.topics.notification.sms}")
private String smsTopic;

Expand All @@ -57,7 +61,6 @@ public class NotificationService {
private String envHost;



/**
* Sends notification by putting the sms content onto the core-sms topic
*
Expand All @@ -73,7 +76,10 @@ public void sendNotification(EmployeeRequest request, Map<String, String> pwdMap
for(Employee employee: request.getEmployees()) {
message = buildMessage(employee, message, pwdMap);
SMSRequest smsRequest = SMSRequest.builder().mobileNumber(employee.getUser().getMobileNumber()).message(message).tenantId(employee.getTenantId()).build();
producer.push(smsTopic, smsRequest);
if(propertiesManager.isSMSForUserCreationEnable())
{
producer.push(smsTopic, smsRequest);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,5 @@ logging.pattern.console=%clr(%X{CORRELATION_ID:-}) %clr(%d{yyyy-MM-dd HH:mm:ss.S

log4j.logger.org.springframework.jdbc.core = TRACE

state.level.tenant.id=pb
state.level.tenant.id=pb
sms.user.creation.enabled=true

0 comments on commit 482d8a5

Please sign in to comment.