Updated code

This commit is contained in:
harish
2024-11-06 14:09:57 +05:30
parent 89e498ccb7
commit 3c1c6c9487
3 changed files with 27 additions and 5 deletions

View File

@@ -578,9 +578,13 @@ public class ApplicationAmendmentRequestDao {
String body = prepareBody(emailTemplate, amendment, beneficiaryUser);
String email = beneficiaryUser.getEmail();
String companyEmail = applicationEntity.getCompany().getEmail();
String contactEmail = applicationEntity.getCompany().getContactEmail();
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));
if (contactEmail != null && !contactEmail.isEmpty() && !contactEmail.equals(companyEmail)) {
emailNotificationDao.sendMail(hub.getId(), subject, body, List.of(contactEmail));
}
// mailUtil.sendByMailGun(subject,body,List.of(email),null);
} else {
throw new CustomValidationException(Status.BAD_REQUEST, Translator.toLocale(GepafinConstant.BENEFICIARY_EMAIL_NOT_FOUND_MSG));