В файле startup.cs у меня есть:
services.AddTransient<IEmailSender, EmailSender>();
services.Configure<AuthMessageSenderOptions>(Configuration);
В EmailSender
класс у меня есть:
public Task SendEmailAsync(string email, string subject, string message)
{
return Execute( subject, message, email);
}
public Task Execute( string subject, string message, string email)
{
var apiKey = Environment.GetEnvironmentVariable("KEY");
//var client = new SendGridClient(apiKey);
var client = new SendGridClient(apiKey);
var msg = new SendGridMessage()
{
From = new EmailAddress("Joe@contoso.com", Options.SendGridUser),
Subject = subject,
PlainTextContent = message,
HtmlContent = message
};
msg.AddTo(new EmailAddress(email));
// Disable click tracking.
// See https://sendgrid.com/docs/User_Guide/Settings/tracking.html
msg.SetClickTracking(false, false);
return client.SendEmailAsync(msg);
}
Я получаю эту страницу вместо отправки почты. Что касается документации Microsoft, у меня нет страницы / Identity / Account / Manage / PersonalData.