Skip to content

Commit

Permalink
DTSPB-4373 fix review issue
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusHMCTS committed Dec 13, 2024
1 parent 586c94f commit 5f84bd0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -198,24 +198,23 @@ public ResponseEntity<CallbackResponse> generateGrant(
documents.add(digitalGrantDocument);
documents.add(coverSheet);
Optional<UserInfo> caseworkerInfo = userInfoService.getCaseworkerInfo();
if (caseData.getOutsideUKGrantCopies() != null && caseData.getOutsideUKGrantCopies() > 0) {
documents.add(notificationService.sendSealedAndCertifiedEmail(caseDetails));
}
if (caseData.isGrantIssuedEmailNotificationRequested()) {
callbackResponse =
eventValidationService.validateEmailRequest(callbackRequest, emailAddressNotifyValidationRules);
if (callbackResponse.getErrors().isEmpty()) {
Document grantIssuedSentEmail =
notificationService.sendEmail(grantState.apply(caseData.getCaseType()), caseDetails);
documents.add(grantIssuedSentEmail);
callbackResponse =
callbackResponseTransformer
.addDocuments(callbackRequest, documents, letterId, pdfSize, caseworkerInfo);
} else {
return ResponseEntity.ok(callbackResponse);
}
} else {
callbackResponse = callbackResponseTransformer.addDocuments(callbackRequest, documents, letterId, pdfSize,
caseworkerInfo);

}
if (caseData.getOutsideUKGrantCopies() != null && caseData.getOutsideUKGrantCopies() > 0) {
documents.add(notificationService.sendSealedAndCertifiedEmail(caseDetails));
}
callbackResponse = callbackResponseTransformer
.addDocuments(callbackRequest, documents, letterId, pdfSize, caseworkerInfo);
return ResponseEntity.ok(callbackResponse);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,12 @@ public Document sendSealedAndCertifiedEmail(CaseDetails caseDetails) throws Noti
deceasedName);
doCommonNotificationServiceHandling(personalisation, caseDetails.getId());

log.info("Sealed And Certified Personlisation complete now get the email response");
log.info("Sealed And Certified get the email response for case {}", caseDetails.getId());

SendEmailResponse response = notificationClientService.sendEmail(templateId,
emailAddresses.getSealedAndCertifiedEmail(), personalisation, reference);

log.info("Send Sealed And Certified completed.");
log.info("Send Sealed And Certified completed for case {}", caseDetails.getId());
return getGeneratedSentEmailDocument(response, emailAddresses.getSealedAndCertifiedEmail(), SENT_EMAIL);
}

Expand Down
2 changes: 0 additions & 2 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,6 @@ notifications:
caveatWithdrawn: "c63bc430-9868-4f10-924b-408c7ac3cbd8"
grantDelayed: "7045b381-a087-44fe-8bb5-e5a591cb8473"
grantAwaitingDocumentation: "cc4aa69b-10fb-4a9c-9e0e-1851dfaa69e9"
sealedAndCertified: "16c9a4ce-162f-4ed1-8d70-be79616685ac"
solicitor:
applicationReceived: "2f282002-6799-47d0-92dd-726960b91c98"
applicationReceivedNoDocs: "60eab724-adec-4d5d-a0a1-aef73ed7da4d"
Expand All @@ -339,7 +338,6 @@ notifications:
grantDelayed: "7045b381-a087-44fe-8bb5-e5a591cb8473"
grantAwaitingDocumentation: "638395bf-805f-48a7-97b1-d26ea9e9334e"
noticeOfChangeReceived: "6af59aa3-b379-406f-9be4-331b8411c6d9"
sealedAndCertified: "16c9a4ce-162f-4ed1-8d70-be79616685ac"

documents:
templates:
Expand Down

0 comments on commit 5f84bd0

Please sign in to comment.