From b8108ce31926543a37f268b18f8a171e5d0f1ff1 Mon Sep 17 00:00:00 2001 From: Murali Basani Date: Wed, 17 Jan 2024 12:35:34 +0100 Subject: [PATCH] Fix for new user mail content (#2213) Signed-off-by: muralibasani Co-authored-by: muralibasani --- .../java/io/aiven/klaw/service/MailUtils.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/io/aiven/klaw/service/MailUtils.java b/core/src/main/java/io/aiven/klaw/service/MailUtils.java index 3c0b425b0d..1ad0981392 100644 --- a/core/src/main/java/io/aiven/klaw/service/MailUtils.java +++ b/core/src/main/java/io/aiven/klaw/service/MailUtils.java @@ -332,7 +332,8 @@ void sendMail(String username, String pwd, HandleDbRequests dbHandle, String log formattedStr = String.format(newUserAdded, username, pwd); subject = "Access to Klaw"; - sendMail(username, dbHandle, formattedStr, subject, false, false, null, tenantId, loginUrl); + sendMail( + username, dbHandle, formattedStr, subject, false, false, null, tenantId, loginUrl, false); } void sendMailResetPwd( @@ -416,7 +417,8 @@ void sendMailRegisteredUserSaas( false, registerUserInfo.getMailid(), tenantId, - loginUrl); + loginUrl, + true); } void sendMailRegisteredUser( @@ -459,7 +461,8 @@ void sendMailRegisteredUser( false, registerUserInfo.getMailid(), tenantId, - loginUrl); + loginUrl, + true); } catch (Exception e) { log.error(registerUserInfo.toString(), e); } @@ -505,7 +508,8 @@ private void sendMail( boolean requiresApproval, String otherMailId, int tenantId, - String loginUrl) { + String loginUrl, + boolean copyTeam) { CompletableFuture.runAsync( () -> { @@ -540,7 +544,9 @@ private void sendMail( log.debug("emailId: {} Team: {}", emailId, emailIdTeam); CollectionUtils.addIgnoreNull(to, emailId); - CollectionUtils.addIgnoreNull(to, emailIdTeam); + if (copyTeam) { + CollectionUtils.addIgnoreNull(to, emailIdTeam); + } emailService.sendSimpleMessage( to, cc, allApprovers, subject, formattedStr, tenantId, loginUrl); } else {