Resolved conflicts while sync with master
This commit is contained in:
@@ -2132,44 +2132,6 @@ public class ApplicationDao {
|
|||||||
tableDataByApp.put(appId, flattenedAll);
|
tableDataByApp.put(appId, flattenedAll);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void sendApplicationSubmissionFailureEmail(EmailLogRequest emailLogRequest){
|
|
||||||
|
|
||||||
Long callId = emailLogRequest.getCallId();
|
|
||||||
CallEntity call = callService.validateCall(callId);
|
|
||||||
HubEntity hub = call.getHub();
|
|
||||||
Long userId = emailLogRequest.getUserId();
|
|
||||||
UserEntity user = userService.validateUser(userId);
|
|
||||||
Long applicationId = emailLogRequest.getApplicatioId();
|
|
||||||
ApplicationEntity applicationEntity = validateApplication(applicationId);
|
|
||||||
CompanyEntity company = companyService.validateCompany(applicationEntity.getCompanyId());
|
|
||||||
|
|
||||||
|
|
||||||
SystemEmailTemplateResponse systemEmailTemplateResponse = systemEmailTemplatesService
|
|
||||||
.retrieveTemplateByTypeAndCall(SystemEmailTemplatesEntityTypeEnum.APPLICATION_SUBMISSION_FAILURE_NOTIFICATION,
|
|
||||||
hub, null);
|
|
||||||
|
|
||||||
Map<String, String> subjectPlaceholders = new HashMap<>();
|
|
||||||
subjectPlaceholders.put("{{call_name}}", call.getName());
|
|
||||||
|
|
||||||
Map<String, String> bodyPlaceholders = new HashMap<>();
|
|
||||||
bodyPlaceholders.put("{{scenario}}",emailLogRequest.getEmailType().getValue());
|
|
||||||
bodyPlaceholders.put("{{call_name}}", call.getName());
|
|
||||||
bodyPlaceholders.put("{{application_id}}", applicationEntity.getId().toString());
|
|
||||||
bodyPlaceholders.put("{{company_name}}", company.getCompanyName());
|
|
||||||
bodyPlaceholders.put("{{protocol_number}}", applicationEntity.getProtocol().getProtocolNumber().toString());
|
|
||||||
bodyPlaceholders.put("{{user_action_id}}",emailLogRequest.getUserActionId().toString());
|
|
||||||
|
|
||||||
String subject = Utils.replacePlaceholders(systemEmailTemplateResponse.getSubject(), subjectPlaceholders);
|
|
||||||
String body = Utils.replacePlaceholders(systemEmailTemplateResponse.getHtmlContent(), bodyPlaceholders);
|
|
||||||
|
|
||||||
emailLogRequest=emailLogDao.createEmailLogRequest(systemEmailTemplateResponse.getEmailScenario(),RecipientTypeEnum.PROPERTIES,null,user.getEmail(),user.getId(),applicationEntity.getId(),null,callId);
|
|
||||||
|
|
||||||
emailLogRequest.setRecipientEmails(GepafinConstant.RINALDO_EMAIL);
|
|
||||||
emailNotificationDao.sendMail(hub.getId(), subject, body, List.of(GepafinConstant.RINALDO_EMAIL),emailLogRequest);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ApplicationResponse readmitApplication(HttpServletRequest request, Long applicationId) {
|
public ApplicationResponse readmitApplication(HttpServletRequest request, Long applicationId) {
|
||||||
log.info("Re-admiting the Application with id : {}", applicationId);
|
log.info("Re-admiting the Application with id : {}", applicationId);
|
||||||
|
|
||||||
@@ -2249,4 +2211,40 @@ public class ApplicationDao {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void sendApplicationSubmissionFailureEmail(EmailLogRequest emailLogRequest){
|
||||||
|
|
||||||
|
Long callId = emailLogRequest.getCallId();
|
||||||
|
CallEntity call = callService.validateCall(callId);
|
||||||
|
HubEntity hub = call.getHub();
|
||||||
|
Long userId = emailLogRequest.getUserId();
|
||||||
|
UserEntity user = userService.validateUser(userId);
|
||||||
|
Long applicationId = emailLogRequest.getApplicatioId();
|
||||||
|
ApplicationEntity applicationEntity = validateApplication(applicationId);
|
||||||
|
CompanyEntity company = companyService.validateCompany(applicationEntity.getCompanyId());
|
||||||
|
|
||||||
|
|
||||||
|
SystemEmailTemplateResponse systemEmailTemplateResponse = systemEmailTemplatesService
|
||||||
|
.retrieveTemplateByTypeAndCall(SystemEmailTemplatesEntityTypeEnum.APPLICATION_SUBMISSION_FAILURE_NOTIFICATION,
|
||||||
|
hub, null);
|
||||||
|
|
||||||
|
Map<String, String> subjectPlaceholders = new HashMap<>();
|
||||||
|
subjectPlaceholders.put("{{call_name}}", call.getName());
|
||||||
|
|
||||||
|
Map<String, String> bodyPlaceholders = new HashMap<>();
|
||||||
|
bodyPlaceholders.put("{{scenario}}",emailLogRequest.getEmailType().getValue());
|
||||||
|
bodyPlaceholders.put("{{call_name}}", call.getName());
|
||||||
|
bodyPlaceholders.put("{{application_id}}", applicationEntity.getId().toString());
|
||||||
|
bodyPlaceholders.put("{{company_name}}", company.getCompanyName());
|
||||||
|
bodyPlaceholders.put("{{protocol_number}}", applicationEntity.getProtocol().getProtocolNumber().toString());
|
||||||
|
bodyPlaceholders.put("{{user_action_id}}",emailLogRequest.getUserActionId().toString());
|
||||||
|
|
||||||
|
String subject = Utils.replacePlaceholders(systemEmailTemplateResponse.getSubject(), subjectPlaceholders);
|
||||||
|
String body = Utils.replacePlaceholders(systemEmailTemplateResponse.getHtmlContent(), bodyPlaceholders);
|
||||||
|
|
||||||
|
emailLogRequest=emailLogDao.createEmailLogRequest(systemEmailTemplateResponse.getEmailScenario(),RecipientTypeEnum.PROPERTIES,null,user.getEmail(),user.getId(),applicationEntity.getId(),null,callId);
|
||||||
|
|
||||||
|
emailLogRequest.setRecipientEmails(GepafinConstant.RINALDO_EMAIL);
|
||||||
|
emailNotificationDao.sendMail(hub.getId(), subject, body, List.of(GepafinConstant.RINALDO_EMAIL),emailLogRequest);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,7 +73,10 @@ public class SystemEmailService implements EmailService {
|
|||||||
|
|
||||||
throw new RuntimeException("Failed to send email via Mailgun: " + (response != null ? response.getMessage() : "No response from Mailgun"), e);
|
throw new RuntimeException("Failed to send email via Mailgun: " + (response != null ? response.getMessage() : "No response from Mailgun"), e);
|
||||||
}
|
}
|
||||||
|
if(response != null) {
|
||||||
emailLogRequest.setEmailServiceResponse(response.toString());
|
emailLogRequest.setEmailServiceResponse(response.toString());
|
||||||
|
}
|
||||||
|
|
||||||
emailLogDao.createEmailLog(emailLogRequest);
|
emailLogDao.createEmailLog(emailLogRequest);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user