mirror of
https://github.com/bitwarden/server.git
synced 2026-02-03 17:43:03 -06:00
Refactor OrganizationInviteBaseView and SendOrganizationInvitesCommand to remove unnecessary properties, streamlining the organization invite email structure and focusing on essential information for user invitations.
This commit is contained in:
parent
2fd1e46e94
commit
a8af2d25f2
@ -5,17 +5,9 @@ namespace Bit.Core.AdminConsole.Models.Mail.Mailer.OrganizationInvite;
|
||||
public abstract class OrganizationInviteBaseView : BaseMailView
|
||||
{
|
||||
public required string OrganizationName { get; set; }
|
||||
public required string OrganizationId { get; set; }
|
||||
public required string OrganizationUserId { get; set; }
|
||||
public required string Email { get; set; }
|
||||
public required string Token { get; set; }
|
||||
public required string ExpirationDate { get; set; }
|
||||
public required string Url { get; set; }
|
||||
public required string ButtonText { get; set; }
|
||||
public required bool InitOrganization { get; set; }
|
||||
public string? InviterEmail { get; set; }
|
||||
public required string WebVaultUrl { get; set; }
|
||||
public required string TitleFirst { get; set; }
|
||||
public required string TitleSecondBold { get; set; }
|
||||
public required string TitleThird { get; set; }
|
||||
}
|
||||
|
||||
@ -232,19 +232,11 @@ public class SendOrganizationInvitesCommand(
|
||||
return new OrganizationInviteEnterpriseTeamsNewUserView
|
||||
{
|
||||
OrganizationName = organizationName,
|
||||
OrganizationId = orgUser.OrganizationId.ToString(),
|
||||
OrganizationUserId = orgUser.Id.ToString(),
|
||||
Email = orgUser.Email,
|
||||
Token = token.Token,
|
||||
ExpirationDate = $"{token.ExpirationDate.ToLongDateString()} {token.ExpirationDate.ToShortTimeString()} UTC",
|
||||
Url = BuildInvitationUrl(orgInvitesInfo, orgUser, token),
|
||||
ButtonText = _newUserButton,
|
||||
InitOrganization = orgInvitesInfo.InitOrganization,
|
||||
InviterEmail = inviterEmail,
|
||||
WebVaultUrl = globalSettings.BaseServiceUri.VaultWithHash,
|
||||
TitleFirst = $"{organizationName} ",
|
||||
TitleSecondBold = _newUserTitle,
|
||||
TitleThird = string.Empty
|
||||
InviterEmail = inviterEmail
|
||||
};
|
||||
}
|
||||
|
||||
@ -255,19 +247,11 @@ public class SendOrganizationInvitesCommand(
|
||||
return new OrganizationInviteEnterpriseTeamsExistingUserView
|
||||
{
|
||||
OrganizationName = organizationName,
|
||||
OrganizationId = orgUser.OrganizationId.ToString(),
|
||||
OrganizationUserId = orgUser.Id.ToString(),
|
||||
Email = orgUser.Email,
|
||||
Token = token.Token,
|
||||
ExpirationDate = $"{token.ExpirationDate.ToLongDateString()} {token.ExpirationDate.ToShortTimeString()} UTC",
|
||||
Url = BuildInvitationUrl(orgInvitesInfo, orgUser, token),
|
||||
ButtonText = _existingUserButton,
|
||||
InitOrganization = orgInvitesInfo.InitOrganization,
|
||||
InviterEmail = inviterEmail,
|
||||
WebVaultUrl = globalSettings.BaseServiceUri.VaultWithHash,
|
||||
TitleFirst = $"{organizationName} ",
|
||||
TitleSecondBold = _existingUserTitle,
|
||||
TitleThird = string.Empty
|
||||
InviterEmail = inviterEmail
|
||||
};
|
||||
}
|
||||
|
||||
@ -278,19 +262,11 @@ public class SendOrganizationInvitesCommand(
|
||||
return new OrganizationInviteFamiliesNewUserView
|
||||
{
|
||||
OrganizationName = organizationName,
|
||||
OrganizationId = orgUser.OrganizationId.ToString(),
|
||||
OrganizationUserId = orgUser.Id.ToString(),
|
||||
Email = orgUser.Email,
|
||||
Token = token.Token,
|
||||
ExpirationDate = $"{token.ExpirationDate.ToLongDateString()} {token.ExpirationDate.ToShortTimeString()} UTC",
|
||||
Url = BuildInvitationUrl(orgInvitesInfo, orgUser, token),
|
||||
ButtonText = _newUserButton,
|
||||
InitOrganization = orgInvitesInfo.InitOrganization,
|
||||
InviterEmail = inviterEmail,
|
||||
WebVaultUrl = globalSettings.BaseServiceUri.VaultWithHash,
|
||||
TitleFirst = $"{organizationName} ",
|
||||
TitleSecondBold = _newUserTitle,
|
||||
TitleThird = string.Empty
|
||||
InviterEmail = inviterEmail
|
||||
};
|
||||
}
|
||||
|
||||
@ -301,19 +277,11 @@ public class SendOrganizationInvitesCommand(
|
||||
return new OrganizationInviteFamiliesExistingUserView
|
||||
{
|
||||
OrganizationName = organizationName,
|
||||
OrganizationId = orgUser.OrganizationId.ToString(),
|
||||
OrganizationUserId = orgUser.Id.ToString(),
|
||||
Email = orgUser.Email,
|
||||
Token = token.Token,
|
||||
ExpirationDate = $"{token.ExpirationDate.ToLongDateString()} {token.ExpirationDate.ToShortTimeString()} UTC",
|
||||
Url = BuildInvitationUrl(orgInvitesInfo, orgUser, token),
|
||||
ButtonText = _existingUserButton,
|
||||
InitOrganization = orgInvitesInfo.InitOrganization,
|
||||
InviterEmail = inviterEmail,
|
||||
WebVaultUrl = globalSettings.BaseServiceUri.VaultWithHash,
|
||||
TitleFirst = $"{organizationName} ",
|
||||
TitleSecondBold = _existingUserTitle,
|
||||
TitleThird = string.Empty
|
||||
InviterEmail = inviterEmail
|
||||
};
|
||||
}
|
||||
|
||||
@ -324,19 +292,11 @@ public class SendOrganizationInvitesCommand(
|
||||
return new OrganizationInviteFreeView
|
||||
{
|
||||
OrganizationName = organizationName,
|
||||
OrganizationId = orgUser.OrganizationId.ToString(),
|
||||
OrganizationUserId = orgUser.Id.ToString(),
|
||||
Email = orgUser.Email,
|
||||
Token = token.Token,
|
||||
ExpirationDate = $"{token.ExpirationDate.ToLongDateString()} {token.ExpirationDate.ToShortTimeString()} UTC",
|
||||
Url = BuildInvitationUrl(orgInvitesInfo, orgUser, token),
|
||||
ButtonText = _existingUserButton,
|
||||
InitOrganization = orgInvitesInfo.InitOrganization,
|
||||
InviterEmail = inviterEmail,
|
||||
WebVaultUrl = globalSettings.BaseServiceUri.VaultWithHash,
|
||||
TitleFirst = _freeOrgTitle,
|
||||
TitleSecondBold = string.Empty,
|
||||
TitleThird = string.Empty
|
||||
InviterEmail = inviterEmail
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user