mirror of
https://github.com/bitwarden/server.git
synced 2025-04-05 05:00:19 -05:00
[Core] Add IMailService.SendBusinessUnitConversionInviteAsync
This commit is contained in:
parent
06c0c4cfc1
commit
0df02d421d
@ -0,0 +1,19 @@
|
|||||||
|
{{#>FullHtmlLayout}}
|
||||||
|
<table width="100%" cellpadding="0" cellspacing="0" style="margin: 0; box-sizing: border-box; color: #333; line-height: 25px; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none;">
|
||||||
|
<tr style="margin: 0; box-sizing: border-box; color: #333; line-height: 25px; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none;">
|
||||||
|
<td class="content-block" style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 16px; color: #333; line-height: 25px; margin: 0; -webkit-font-smoothing: antialiased; padding: 0 0 10px; -webkit-text-size-adjust: none; text-align: left;" valign="top" align="center">
|
||||||
|
You have been invited to set up a new Business Unit Portal within Bitwarden.
|
||||||
|
<br style="margin: 0; box-sizing: border-box; color: #333; line-height: 25px; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none;" />
|
||||||
|
<br style="margin: 0; box-sizing: border-box; color: #333; line-height: 25px; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none;" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr style="margin: 0; box-sizing: border-box; color: #333; line-height: 25px; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none;">
|
||||||
|
<td class="content-block" style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 16px; color: #333; line-height: 25px; margin: 0; -webkit-font-smoothing: antialiased; padding: 0 0 10px; -webkit-text-size-adjust: none; text-align: center;" valign="top" align="center">
|
||||||
|
<a href="{{{Url}}}" clicktracking=off target="_blank" style="color: #ffffff; text-decoration: none; text-align: center; cursor: pointer; display: inline-block; border-radius: 5px; background-color: #175DDC; border-color: #175DDC; border-style: solid; border-width: 10px 20px; margin: 0; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 16px; line-height: 25px; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none;">
|
||||||
|
Set Up Business Unit Portal Now
|
||||||
|
</a>
|
||||||
|
<br style="margin: 0; box-sizing: border-box; color: #333; line-height: 25px; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none;" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
{{/FullHtmlLayout}}
|
@ -0,0 +1,5 @@
|
|||||||
|
{{#>BasicTextLayout}}
|
||||||
|
You have been invited to set up a new Business Unit Portal within Bitwarden. To continue, click the following link:
|
||||||
|
|
||||||
|
{{{Url}}}
|
||||||
|
{{/BasicTextLayout}}
|
@ -0,0 +1,11 @@
|
|||||||
|
namespace Bit.Core.Models.Mail.Billing;
|
||||||
|
|
||||||
|
public class BusinessUnitConversionInviteModel : BaseMailModel
|
||||||
|
{
|
||||||
|
public string OrganizationId { get; set; }
|
||||||
|
public string Email { get; set; }
|
||||||
|
public string Token { get; set; }
|
||||||
|
|
||||||
|
public string Url =>
|
||||||
|
$"{WebVaultUrl}/providers/setup-business-unit?organizationId={OrganizationId}&email={Email}&token={Token}";
|
||||||
|
}
|
@ -70,6 +70,7 @@ public interface IMailService
|
|||||||
Task SendEnqueuedMailMessageAsync(IMailQueueMessage queueMessage);
|
Task SendEnqueuedMailMessageAsync(IMailQueueMessage queueMessage);
|
||||||
Task SendAdminResetPasswordEmailAsync(string email, string userName, string orgName);
|
Task SendAdminResetPasswordEmailAsync(string email, string userName, string orgName);
|
||||||
Task SendProviderSetupInviteEmailAsync(Provider provider, string token, string email);
|
Task SendProviderSetupInviteEmailAsync(Provider provider, string token, string email);
|
||||||
|
Task SendBusinessUnitConversionInviteAsync(Organization organization, string token, string email);
|
||||||
Task SendProviderInviteEmailAsync(string providerName, ProviderUser providerUser, string token, string email);
|
Task SendProviderInviteEmailAsync(string providerName, ProviderUser providerUser, string token, string email);
|
||||||
Task SendProviderConfirmedEmailAsync(string providerName, string email);
|
Task SendProviderConfirmedEmailAsync(string providerName, string email);
|
||||||
Task SendProviderUserRemoved(string providerName, string email);
|
Task SendProviderUserRemoved(string providerName, string email);
|
||||||
|
@ -11,6 +11,7 @@ using Bit.Core.Billing.Models.Mail;
|
|||||||
using Bit.Core.Entities;
|
using Bit.Core.Entities;
|
||||||
using Bit.Core.Models.Data.Organizations;
|
using Bit.Core.Models.Data.Organizations;
|
||||||
using Bit.Core.Models.Mail;
|
using Bit.Core.Models.Mail;
|
||||||
|
using Bit.Core.Models.Mail.Billing;
|
||||||
using Bit.Core.Models.Mail.FamiliesForEnterprise;
|
using Bit.Core.Models.Mail.FamiliesForEnterprise;
|
||||||
using Bit.Core.Models.Mail.Provider;
|
using Bit.Core.Models.Mail.Provider;
|
||||||
using Bit.Core.SecretsManager.Models.Mail;
|
using Bit.Core.SecretsManager.Models.Mail;
|
||||||
@ -951,6 +952,22 @@ public class HandlebarsMailService : IMailService
|
|||||||
await _mailDeliveryService.SendEmailAsync(message);
|
await _mailDeliveryService.SendEmailAsync(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task SendBusinessUnitConversionInviteAsync(Organization organization, string token, string email)
|
||||||
|
{
|
||||||
|
var message = CreateDefaultMessage("Set Up Business Unit", email);
|
||||||
|
var model = new BusinessUnitConversionInviteModel
|
||||||
|
{
|
||||||
|
WebVaultUrl = _globalSettings.BaseServiceUri.VaultWithHash,
|
||||||
|
SiteName = _globalSettings.SiteName,
|
||||||
|
OrganizationId = organization.Id.ToString(),
|
||||||
|
Email = WebUtility.UrlEncode(email),
|
||||||
|
Token = WebUtility.UrlEncode(token)
|
||||||
|
};
|
||||||
|
await AddMessageContentAsync(message, "Billing.BusinessUnitConversionInvite", model);
|
||||||
|
message.Category = "BusinessUnitConversionInvite";
|
||||||
|
await _mailDeliveryService.SendEmailAsync(message);
|
||||||
|
}
|
||||||
|
|
||||||
public async Task SendProviderInviteEmailAsync(string providerName, ProviderUser providerUser, string token, string email)
|
public async Task SendProviderInviteEmailAsync(string providerName, ProviderUser providerUser, string token, string email)
|
||||||
{
|
{
|
||||||
var message = CreateDefaultMessage($"Join {providerName}", email);
|
var message = CreateDefaultMessage($"Join {providerName}", email);
|
||||||
|
@ -212,6 +212,11 @@ public class NoopMailService : IMailService
|
|||||||
return Task.FromResult(0);
|
return Task.FromResult(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Task SendBusinessUnitConversionInviteAsync(Organization organization, string token, string email)
|
||||||
|
{
|
||||||
|
return Task.FromResult(0);
|
||||||
|
}
|
||||||
|
|
||||||
public Task SendProviderInviteEmailAsync(string providerName, ProviderUser providerUser, string token, string email)
|
public Task SendProviderInviteEmailAsync(string providerName, ProviderUser providerUser, string token, string email)
|
||||||
{
|
{
|
||||||
return Task.FromResult(0);
|
return Task.FromResult(0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user