From 042547bb59d575b67c7b2466d21a7ebe12190f6c Mon Sep 17 00:00:00 2001 From: Stefan Berthold Date: Tue, 17 Dec 2024 10:20:22 +0000 Subject: [PATCH 1/3] add profile name to new-team-owner-welcome-email template --- services/brig/src/Brig/API/User.hs | 1 + services/brig/src/Brig/Team/Email.hs | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/services/brig/src/Brig/API/User.hs b/services/brig/src/Brig/API/User.hs index 92d260f6d2f..c6adbf99ffd 100644 --- a/services/brig/src/Brig/API/User.hs +++ b/services/brig/src/Brig/API/User.hs @@ -302,6 +302,7 @@ upgradePersonalToTeam luid bNewTeam = do tid bNewTeam.bnuTeam.newTeamName.fromRange (Just user.userLocale) + user.userDisplayName pure $! createUserTeam diff --git a/services/brig/src/Brig/Team/Email.hs b/services/brig/src/Brig/Team/Email.hs index e9c22b1f82a..90dc3519483 100644 --- a/services/brig/src/Brig/Team/Email.hs +++ b/services/brig/src/Brig/Team/Email.hs @@ -40,11 +40,11 @@ sendMemberWelcomeMail to tid teamName loc = do branding <- asks (.templateBranding) liftSem $ sendMail $ renderMemberWelcomeMail to tid teamName tpl branding -sendNewTeamOwnerWelcomeEmail :: (Member EmailSending r) => EmailAddress -> TeamId -> Text -> Maybe Locale -> (AppT r) () -sendNewTeamOwnerWelcomeEmail to tid teamName loc = do +sendNewTeamOwnerWelcomeEmail :: (Member EmailSending r) => EmailAddress -> TeamId -> Text -> Maybe Locale -> Name -> (AppT r) () +sendNewTeamOwnerWelcomeEmail to tid teamName loc profileName = do tpl <- newTeamOwnerWelcomeEmail . snd <$> teamTemplatesWithLocale loc branding <- asks (.templateBranding) - liftSem $ sendMail $ renderNewTeamOwnerWelcomeEmail to tid teamName tpl branding + liftSem $ sendMail $ renderNewTeamOwnerWelcomeEmail to tid teamName profileName tpl branding ------------------------------------------------------------------------------- -- Member Welcome Email @@ -74,8 +74,8 @@ renderMemberWelcomeMail emailTo tid teamName MemberWelcomeEmailTemplate {..} bra ------------------------------------------------------------------------------- -- New Team Owner Welcome Email -renderNewTeamOwnerWelcomeEmail :: EmailAddress -> TeamId -> Text -> NewTeamOwnerWelcomeEmailTemplate -> TemplateBranding -> Mail -renderNewTeamOwnerWelcomeEmail emailTo tid teamName NewTeamOwnerWelcomeEmailTemplate {..} branding = +renderNewTeamOwnerWelcomeEmail :: EmailAddress -> TeamId -> Text -> Name -> NewTeamOwnerWelcomeEmailTemplate -> TemplateBranding -> Mail +renderNewTeamOwnerWelcomeEmail emailTo tid teamName profileName NewTeamOwnerWelcomeEmailTemplate {..} branding = (emptyMail from) { mailTo = [to], mailHeaders = @@ -94,4 +94,5 @@ renderNewTeamOwnerWelcomeEmail emailTo tid teamName NewTeamOwnerWelcomeEmailTemp replace "email" = fromEmail emailTo replace "team_id" = idToText tid replace "team_name" = teamName + replace "name" = profileName.fromName replace x = x From 03d0e42770ad507dafd1371b05b9b3efb99c5096 Mon Sep 17 00:00:00 2001 From: Stefan Berthold Date: Tue, 17 Dec 2024 10:49:01 +0000 Subject: [PATCH 2/3] remove PersonalUserMemberWelcomeEmailTemplate --- .../src/Wire/EmailSubsystem/Template.hs | 10 ---------- services/brig/src/Brig/Team/Template.hs | 8 -------- 2 files changed, 18 deletions(-) diff --git a/libs/wire-subsystems/src/Wire/EmailSubsystem/Template.hs b/libs/wire-subsystems/src/Wire/EmailSubsystem/Template.hs index 7c209b2972a..15a31a04eba 100644 --- a/libs/wire-subsystems/src/Wire/EmailSubsystem/Template.hs +++ b/libs/wire-subsystems/src/Wire/EmailSubsystem/Template.hs @@ -210,15 +210,6 @@ data MemberWelcomeEmailTemplate = MemberWelcomeEmailTemplate memberWelcomeEmailSenderName :: !Text } -data PersonalUserMemberWelcomeEmailTemplate = PersonalUserMemberWelcomeEmailTemplate - { personalUserMemberWelcomeEmailUrl :: !Text, - personalUserMemberWelcomeEmailSubject :: !Template, - personalUserMemberWelcomeEmailBodyText :: !Template, - personalUserMemberWelcomeEmailBodyHtml :: !Template, - personalUserMemberWelcomeEmailSender :: !EmailAddress, - personalUserMemberWelcomeEmailSenderName :: !Text - } - data NewTeamOwnerWelcomeEmailTemplate = NewTeamOwnerWelcomeEmailTemplate { newTeamOwnerWelcomeEmailUrl :: !Text, newTeamOwnerWelcomeEmailSubject :: !Template, @@ -233,6 +224,5 @@ data TeamTemplates = TeamTemplates existingUserInvitationEmail :: !InvitationEmailTemplate, creatorWelcomeEmail :: !CreatorWelcomeEmailTemplate, memberWelcomeEmail :: !MemberWelcomeEmailTemplate, - personalUserMemberWelcomeEmail :: !PersonalUserMemberWelcomeEmailTemplate, newTeamOwnerWelcomeEmail :: !NewTeamOwnerWelcomeEmailTemplate } diff --git a/services/brig/src/Brig/Team/Template.hs b/services/brig/src/Brig/Team/Template.hs index 713c1555a6f..4ca5feccfdf 100644 --- a/services/brig/src/Brig/Team/Template.hs +++ b/services/brig/src/Brig/Team/Template.hs @@ -63,14 +63,6 @@ loadTeamTemplates o = readLocalesDir defLocale (templateDir gOptions) "team" $ \ <*> pure (emailSender gOptions) <*> readText fp "email/sender.txt" ) - <*> ( PersonalUserMemberWelcomeEmailTemplate - "" - (template "") - (template "") - (template "") - (emailSender gOptions) - <$> readText fp "email/sender.txt" - ) <*> ( NewTeamOwnerWelcomeEmailTemplate (tCreatorWelcomeUrl tOptions) <$> readTemplate fp "email/new-team-owner-welcome-subject.txt" <*> readTemplate fp "email/new-team-owner-welcome.txt" From dc65c54e4857dfe6369ecd46c3fe7528f93a5cb6 Mon Sep 17 00:00:00 2001 From: Stefan Berthold Date: Tue, 17 Dec 2024 10:56:39 +0000 Subject: [PATCH 3/3] add changelog --- changelog.d/3-bug-fixes/WPB-15085 | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/3-bug-fixes/WPB-15085 diff --git a/changelog.d/3-bug-fixes/WPB-15085 b/changelog.d/3-bug-fixes/WPB-15085 new file mode 100644 index 00000000000..1fa867f5fe9 --- /dev/null +++ b/changelog.d/3-bug-fixes/WPB-15085 @@ -0,0 +1 @@ +Add profile name to new team owner welcome mail