mirror of
https://github.com/bitwarden/server.git
synced 2025-06-14 15:00:49 -05:00
WIP
This commit is contained in:
parent
390b93f6ce
commit
159d4cc32d
@ -0,0 +1,9 @@
|
||||
using Bit.Core.Platform.Services;
|
||||
|
||||
namespace Bit.Core.Auth.UserFeatures.Registration.VerifyEmail;
|
||||
|
||||
public class VerifyEmail(string url) : BaseMailModel2
|
||||
{
|
||||
public override string Subject { get; set; } = "Verify Your Email";
|
||||
public string Url { get; } = url;
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
{{#>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">
|
||||
Verify this email address for your Bitwarden account by clicking the link below.
|
||||
</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 last" 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; -webkit-text-size-adjust: none; text-align: left;" valign="top" align="center">
|
||||
If you did not request to verify a Bitwarden account, you can safely ignore this email.
|
||||
<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;">
|
||||
Verify Email Address 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,8 @@
|
||||
{{#>BasicTextLayout}}
|
||||
Verify this email address for your Bitwarden account by clicking the link below.
|
||||
|
||||
If you did not request to verify a Bitwarden account, you can safely ignore this email.
|
||||
|
||||
{{{Url}}}
|
||||
|
||||
{{/BasicTextLayout}}
|
@ -1,4 +1,5 @@
|
||||
{{#>FullUpdatedHtmlLayout}}
|
||||
|
||||
{{#>FullUpdatedHtmlLayout}}
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="background-color: #175DDC;padding-top:45px; ">
|
||||
<tr>
|
||||
<td align="center" valign="top" width="70%" class="templateColumnContainer">
|
||||
@ -41,4 +42,4 @@
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
{{/FullUpdatedHtmlLayout}}
|
||||
{{/FullUpdatedHtmlLayout}}
|
||||
|
30
src/Core/Platform/Services/IMailModel.cs
Normal file
30
src/Core/Platform/Services/IMailModel.cs
Normal file
@ -0,0 +1,30 @@
|
||||
namespace Bit.Core.Platform.Services;
|
||||
|
||||
#nullable enable
|
||||
|
||||
/// <summary>
|
||||
/// IMail describes a view model for emails. Any propery in the view model are available for usage
|
||||
/// in the email templates.
|
||||
///
|
||||
/// Each Mail consists of two body parts: a text part and an HTML part and the filename must be
|
||||
/// relative to the viewmodel and match the following pattern:
|
||||
/// - `{ClassName}.html.hbs` for the HTML part
|
||||
/// - `{ClassName}.txt.hbs` for the text part
|
||||
/// </summary>
|
||||
public abstract class BaseMailModel2
|
||||
{
|
||||
/// <summary>
|
||||
/// The subject of the email.
|
||||
/// </summary>
|
||||
public abstract string Subject { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// An optional category for processing at the upstream email delivery service.
|
||||
/// </summary>
|
||||
public string? Category { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Current year.
|
||||
/// </summary>
|
||||
public string CurrentYear => DateTime.UtcNow.Year.ToString();
|
||||
}
|
23
src/Core/Platform/Services/IMailer.cs
Normal file
23
src/Core/Platform/Services/IMailer.cs
Normal file
@ -0,0 +1,23 @@
|
||||
namespace Bit.Core.Platform.Services;
|
||||
|
||||
#nullable enable
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public interface IMailer
|
||||
{
|
||||
/// <summary>
|
||||
/// Sends an email message to the specified recipient.
|
||||
/// </summary>
|
||||
/// <param name="message"></param>
|
||||
/// <param name="recipient">Recipient email</param>
|
||||
public void SendEmail(BaseMailModel2 message, string recipient);
|
||||
|
||||
/// <summary>
|
||||
/// Sends multiple emails message to the specified recipients.
|
||||
/// </summary>
|
||||
/// <param name="message"></param>
|
||||
/// <param name="recipients">Recipient emails</param>
|
||||
public void SendEmails(BaseMailModel2 message, string[] recipients);
|
||||
}
|
11
src/Core/Platform/Services/Mailer.cs
Normal file
11
src/Core/Platform/Services/Mailer.cs
Normal file
@ -0,0 +1,11 @@
|
||||
namespace Bit.Core.Platform.Services;
|
||||
|
||||
#nullable enable
|
||||
|
||||
|
||||
public class Mailer : IMailer
|
||||
{
|
||||
public void SendEmail(BaseMailModel2 message, string recipient) => throw new NotImplementedException();
|
||||
|
||||
public void SendEmails(BaseMailModel2 message, string[] recipients) => throw new NotImplementedException();
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user