Skip to content

Commit

Permalink
🐛 Bug(email): fix partner email when deleting an account that don't h…
Browse files Browse the repository at this point in the history
…ave any name
  • Loading branch information
mattboll committed Oct 22, 2024
1 parent 1293a48 commit 74568d6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;

import static fr.dossierfacile.common.enums.ApplicationType.COUPLE;
import static fr.dossierfacile.common.enums.ApplicationType.GROUP;
Expand Down Expand Up @@ -96,7 +97,9 @@ private void sendEmailToTenant(String email, String tenantFullName, Map<String,
}
SendSmtpEmail sendSmtpEmail = new SendSmtpEmail();
sendSmtpEmail.templateId(templateId);
sendSmtpEmail.params(params);
if (params.values().stream().anyMatch(Objects::nonNull)) {
sendSmtpEmail.params(params);
}
sendSmtpEmail.to(Collections.singletonList(sendSmtpEmailTo));

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ public void deleteAccount(Tenant tenant) {

TransactionalUtil.afterCommit(() -> {
mailService.sendEmailAccountDeleted(tenantToDeleteDto);
keycloakService.deleteKeycloakUserById(keycloakId);
if (StringUtils.isNotBlank(keycloakId)) {
keycloakService.deleteKeycloakUserById(keycloakId);
}
});
}

Expand Down

0 comments on commit 74568d6

Please sign in to comment.