Updated code for reminder endpoint

This commit is contained in:
harish
2024-11-05 12:15:06 +05:30
parent 838905cbc2
commit f51379bd4d
2 changed files with 4 additions and 2 deletions

View File

@@ -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));