1
0
mirror of https://github.com/bitwarden/server synced 2025-12-15 07:43:54 +00:00

chore: remove FF, references, and restructure code, refs PM-24373 (#6353)

This commit is contained in:
Vincent Salucci
2025-09-18 15:08:47 -05:00
committed by GitHub
parent 9d3d35e0bf
commit 7e4dac9837
5 changed files with 10 additions and 63 deletions

View File

@@ -355,11 +355,8 @@ public class HandlebarsMailService : IMailService
{
Debug.Assert(orgUserTokenPair.OrgUser.Email is not null);
var orgUserInviteViewModel = orgInvitesInfo.IsSubjectFeatureEnabled
? OrganizationUserInvitedViewModel.CreateFromInviteInfo_v2(
orgInvitesInfo, orgUserTokenPair.OrgUser, orgUserTokenPair.Token, _globalSettings)
: OrganizationUserInvitedViewModel.CreateFromInviteInfo(orgInvitesInfo, orgUserTokenPair.OrgUser,
orgUserTokenPair.Token, _globalSettings);
var orgUserInviteViewModel = OrganizationUserInvitedViewModel.CreateFromInviteInfo(orgInvitesInfo, orgUserTokenPair.OrgUser,
orgUserTokenPair.Token, _globalSettings);
return CreateMessage(orgUserTokenPair.OrgUser.Email, orgUserInviteViewModel);
});
@@ -369,20 +366,15 @@ public class HandlebarsMailService : IMailService
MailQueueMessage CreateMessage(string email, OrganizationUserInvitedViewModel model)
{
var subject = $"Join {model.OrganizationName}";
ArgumentNullException.ThrowIfNull(model);
if (orgInvitesInfo.IsSubjectFeatureEnabled)
var subject = model! switch
{
ArgumentNullException.ThrowIfNull(model);
subject = model! switch
{
{ IsFreeOrg: true, OrgUserHasExistingUser: true } => "You have been invited to a Bitwarden Organization",
{ IsFreeOrg: true, OrgUserHasExistingUser: false } => "You have been invited to Bitwarden Password Manager",
{ IsFreeOrg: false, OrgUserHasExistingUser: true } => $"{model.OrganizationName} invited you to their Bitwarden organization",
{ IsFreeOrg: false, OrgUserHasExistingUser: false } => $"{model.OrganizationName} set up a Bitwarden account for you"
};
}
{ IsFreeOrg: true, OrgUserHasExistingUser: true } => "You have been invited to a Bitwarden Organization",
{ IsFreeOrg: true, OrgUserHasExistingUser: false } => "You have been invited to Bitwarden Password Manager",
{ IsFreeOrg: false, OrgUserHasExistingUser: true } => $"{model.OrganizationName} invited you to their Bitwarden organization",
{ IsFreeOrg: false, OrgUserHasExistingUser: false } => $"{model.OrganizationName} set up a Bitwarden account for you"
};
var message = CreateDefaultMessage(subject, email);