mirror of
https://github.com/bitwarden/server
synced 2025-12-18 09:13:19 +00:00
[PM-23493] Generic mailer proposal (#5958)
This implements a new Mailer service which supersedes the `HandlebarsMailService`. It allows teams to create emails without having to extend a generic service. The `IMailer` only contains a single method, `SendEmail`, which sends an instance of `BaseMail`.
This commit is contained in:
@@ -38,6 +38,7 @@ using Bit.Core.KeyManagement;
|
||||
using Bit.Core.NotificationCenter;
|
||||
using Bit.Core.OrganizationFeatures;
|
||||
using Bit.Core.Platform;
|
||||
using Bit.Core.Platform.Mailer;
|
||||
using Bit.Core.Platform.Push;
|
||||
using Bit.Core.Platform.PushRegistration.Internal;
|
||||
using Bit.Core.Repositories;
|
||||
@@ -242,8 +243,11 @@ public static class ServiceCollectionExtensions
|
||||
services.AddScoped<IPaymentService, StripePaymentService>();
|
||||
services.AddScoped<IPaymentHistoryService, PaymentHistoryService>();
|
||||
services.AddScoped<ITwoFactorEmailService, TwoFactorEmailService>();
|
||||
// Legacy mailer service
|
||||
services.AddSingleton<IStripeSyncService, StripeSyncService>();
|
||||
services.AddSingleton<IMailService, HandlebarsMailService>();
|
||||
// Modern mailers
|
||||
services.AddMailer();
|
||||
services.AddSingleton<ILicensingService, LicensingService>();
|
||||
services.AddSingleton<ILookupClient>(_ =>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user