From f51379bd4dfe9dc38d12fa402681f9258841035a Mon Sep 17 00:00:00 2001 From: harish Date: Tue, 5 Nov 2024 12:15:06 +0530 Subject: [PATCH] Updated code for reminder endpoint --- .../tendermanagement/dao/ApplicationAmendmentRequestDao.java | 4 +++- .../web/rest/api/ApplicationAmendmentRequestApi.java | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/gepafin/tendermanagement/dao/ApplicationAmendmentRequestDao.java b/src/main/java/net/gepafin/tendermanagement/dao/ApplicationAmendmentRequestDao.java index 63ecc6c7..0652edaf 100644 --- a/src/main/java/net/gepafin/tendermanagement/dao/ApplicationAmendmentRequestDao.java +++ b/src/main/java/net/gepafin/tendermanagement/dao/ApplicationAmendmentRequestDao.java @@ -508,8 +508,10 @@ public class ApplicationAmendmentRequestDao { String subject = prepareSubject(emailTemplate, amendment, beneficiaryUser); String body = prepareBody(emailTemplate, amendment, beneficiaryUser); String email = beneficiaryUser.getEmail(); - if (Boolean.TRUE.equals(amendment.getIsEmail())&&email != null && !email.isEmpty()) { + String companyEmail = applicationEntity.getCompany().getEmail(); + if (Boolean.TRUE.equals(amendment.getIsEmail())&&email != null && !email.isEmpty() && companyEmail != null && !companyEmail.isEmpty()) { emailNotificationDao.sendMail(hub.getId(), subject, body, List.of(email)); + emailNotificationDao.sendMail(hub.getId(), subject, body, List.of(companyEmail)); // mailUtil.sendByMailGun(subject,body,List.of(email),null); } else { throw new CustomValidationException(Status.BAD_REQUEST, Translator.toLocale(GepafinConstant.BENEFICIARY_EMAIL_NOT_FOUND_MSG)); diff --git a/src/main/java/net/gepafin/tendermanagement/web/rest/api/ApplicationAmendmentRequestApi.java b/src/main/java/net/gepafin/tendermanagement/web/rest/api/ApplicationAmendmentRequestApi.java index 42977539..10c3128b 100644 --- a/src/main/java/net/gepafin/tendermanagement/web/rest/api/ApplicationAmendmentRequestApi.java +++ b/src/main/java/net/gepafin/tendermanagement/web/rest/api/ApplicationAmendmentRequestApi.java @@ -181,7 +181,7 @@ public interface ApplicationAmendmentRequestApi { @ApiResponse(responseCode = "401", description = "Unauthorized", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = { @ExampleObject(value = ErrorConstants.UNAUTHORIZED_ERROR_EXAMPLE) })) }) - @PostMapping(value = "sendReminderEmail/{amendmentId}", produces = MediaType.APPLICATION_JSON_VALUE) + @PostMapping(value = "/{amendmentId}/reminder", produces = MediaType.APPLICATION_JSON_VALUE) ResponseEntity> sendReminderEmail(HttpServletRequest request, @Parameter( required = true) @PathVariable(value = "amendmentId") Long amendmentId);