2021-11-30 14:32:10 +01:00
|
|
|
using Microsoft.Extensions.Configuration;
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
|
|
|
|
|
namespace zero.Mails;
|
|
|
|
|
|
2022-01-06 18:10:58 +01:00
|
|
|
internal class ZeroMailModule : ZeroModule
|
2021-11-30 14:32:10 +01:00
|
|
|
{
|
|
|
|
|
public override void ConfigureServices(IServiceCollection services, IConfiguration configuration)
|
|
|
|
|
{
|
|
|
|
|
services.AddScoped<IMailProvider, MailProvider>();
|
|
|
|
|
services.AddScoped<IMailDispatcher, LoggerMailDispatcher>();
|
|
|
|
|
services.AddScoped<IMailTemplatesStore, MailTemplatesStore>();
|
2022-01-09 13:48:20 +01:00
|
|
|
|
|
|
|
|
services.AddOptions<MailOptions>().Configure(opts =>
|
|
|
|
|
{
|
|
|
|
|
opts.BuildViewPath = mail => $"~/Views/Mails/{mail.Template.Key.Replace('.', '/')}.cshtml";
|
|
|
|
|
});
|
2021-11-30 14:32:10 +01:00
|
|
|
}
|
|
|
|
|
}
|