Fake-Mailversand;
This commit is contained in:
16
MultipleChoiceTrainer/Services/EmailSender.cs
Normal file
16
MultipleChoiceTrainer/Services/EmailSender.cs
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
using Microsoft.AspNetCore.Identity.UI.Services;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace MultipleChoiceTrainer.Services
|
||||||
|
{
|
||||||
|
public class EmailSender : IEmailSender
|
||||||
|
{
|
||||||
|
public Task SendEmailAsync(string email, string subject, string htmlMessage)
|
||||||
|
{
|
||||||
|
return Task.Run(() => System.Threading.Thread.Sleep(0));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -12,6 +12,8 @@ using MultipleChoiceTrainer.Data;
|
|||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.Hosting;
|
using Microsoft.Extensions.Hosting;
|
||||||
|
using Microsoft.AspNetCore.Identity.UI.Services;
|
||||||
|
using MultipleChoiceTrainer.Services;
|
||||||
|
|
||||||
namespace MultipleChoiceTrainer
|
namespace MultipleChoiceTrainer
|
||||||
{
|
{
|
||||||
@@ -30,6 +32,7 @@ namespace MultipleChoiceTrainer
|
|||||||
AddDbContext(services);
|
AddDbContext(services);
|
||||||
services.AddDefaultIdentity<IdentityUser>(options => options.SignIn.RequireConfirmedAccount = true)
|
services.AddDefaultIdentity<IdentityUser>(options => options.SignIn.RequireConfirmedAccount = true)
|
||||||
.AddEntityFrameworkStores<ApplicationDbContext>();
|
.AddEntityFrameworkStores<ApplicationDbContext>();
|
||||||
|
services.AddTransient<IEmailSender, EmailSender>();
|
||||||
services.AddControllersWithViews();
|
services.AddControllersWithViews();
|
||||||
services.AddRazorPages();
|
services.AddRazorPages();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user