Done changes with respect to pec
This commit is contained in:
@@ -1222,26 +1222,39 @@ public class ApplicationDao {
|
||||
String email = userEntity.getEmail();
|
||||
if (userEntity.getBeneficiary() != null) {
|
||||
emailLogRequest.setRecipientType(RecipientTypeEnum.BENEFICIARY);
|
||||
email = userEntity.getBeneficiary().getEmail();
|
||||
emailLogRequest.setRecipientId(userEntity.getBeneficiary().getId());
|
||||
|
||||
if(Boolean.TRUE.equals(hub.getUniqueUuid().equals(defaultHubUuid))){
|
||||
email=applicationEntity.getPecEmail();
|
||||
}else {
|
||||
email = userEntity.getBeneficiary().getEmail();
|
||||
}
|
||||
emailLogRequest.setRecipientId(userEntity.getBeneficiary().getId());
|
||||
}
|
||||
emailNotificationDao.sendMail(hub.getId(), subject, body, List.of(email),emailLogRequest);
|
||||
List<String> recipientEmails = new ArrayList<>();
|
||||
// recipientEmails.add(email);
|
||||
String companyEmail = userWithCompany.getEmail();
|
||||
String contactEmail = userWithCompany.getContactEmail();
|
||||
if(Boolean.TRUE.equals(hub.getUniqueUuid().equals(defaultHubUuid))){
|
||||
if (company.getPec()!=null) {
|
||||
recipientEmails.add(company.getPec());
|
||||
}else {
|
||||
recipientEmails.add(userWithCompany.getPec());
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (companyEmail != null && !companyEmail.isEmpty()) {
|
||||
recipientEmails.add(companyEmail);
|
||||
}
|
||||
|
||||
if (companyEmail != null && !companyEmail.isEmpty()) {
|
||||
recipientEmails.add(companyEmail);
|
||||
}
|
||||
|
||||
if (contactEmail != null && !contactEmail.isEmpty() && !contactEmail.equals(companyEmail)) {
|
||||
recipientEmails.add(contactEmail);
|
||||
}
|
||||
if (contactEmail != null && !contactEmail.isEmpty() && !contactEmail.equals(companyEmail)) {
|
||||
recipientEmails.add(contactEmail);
|
||||
}
|
||||
}
|
||||
if(Boolean.FALSE.equals(recipientEmails.isEmpty())){
|
||||
emailLogRequest.setRecipientId(applicationEntity.getCompanyId());
|
||||
emailLogRequest.setRecipientType(RecipientTypeEnum.COMPANY);
|
||||
emailLogRequest.setRecipientEmails(companyEmail);
|
||||
emailLogRequest.setRecipientEmails(String.valueOf(recipientEmails));
|
||||
}
|
||||
emailNotificationDao.sendMail(hub.getId(), subject, body, recipientEmails,emailLogRequest);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user