Updated code
This commit is contained in:
@@ -578,15 +578,8 @@ public class ApplicationAmendmentRequestDao {
|
|||||||
String subject = prepareSubject(emailTemplate, amendment, beneficiaryUser);
|
String subject = prepareSubject(emailTemplate, amendment, beneficiaryUser);
|
||||||
String body = prepareBody(emailTemplate, amendment, beneficiaryUser);
|
String body = prepareBody(emailTemplate, amendment, beneficiaryUser);
|
||||||
String email = beneficiaryUser.getEmail();
|
String email = beneficiaryUser.getEmail();
|
||||||
String companyEmail = applicationEntity.getCompany().getEmail();
|
if (Boolean.TRUE.equals(amendment.getIsEmail())&&email != null && !email.isEmpty()) {
|
||||||
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(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 {
|
} else {
|
||||||
throw new CustomValidationException(Status.BAD_REQUEST, Translator.toLocale(GepafinConstant.BENEFICIARY_EMAIL_NOT_FOUND_MSG));
|
throw new CustomValidationException(Status.BAD_REQUEST, Translator.toLocale(GepafinConstant.BENEFICIARY_EMAIL_NOT_FOUND_MSG));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user