/
githubmirror
/
aspnetcore
Обзор
Документация
Войти
/
githubmirror
/
aspnetcore
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Shared/DefaultMessageEmailSender.cs
20 строк
1 KB
Grant Totinov
Improve default Identity email wording for recipients who didn't initiate the action (#66747)
08 июн 2026, 21:06
Не верифицирован
08 июн 2026, 21:06
cbdd640
Код
Авторство
О чём код?
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.AspNetCore.Identity.UI.Services; namespace Microsoft.AspNetCore.Identity; internal sealed class DefaultMessageEmailSender<TUser>(IEmailSender emailSender) : IEmailSender<TUser> where TUser : class { internal bool IsNoOp => emailSender is NoOpEmailSender; public Task SendConfirmationLinkAsync(TUser user, string email, string confirmationLink) => emailSender.SendEmailAsync(email, "Confirm your email", $"Please confirm your account by <a href='{confirmationLink}'>clicking here</a>. If you didn't request this email confirmation, you can ignore this email."); public Task SendPasswordResetLinkAsync(TUser user, string email, string resetLink) => emailSender.SendEmailAsync(email, "Reset your password", $"Please reset your password by <a href='{resetLink}'>clicking here</a>. If you didn't request a password reset, you can ignore this email."); public Task SendPasswordResetCodeAsync(TUser user, string email, string resetCode) => emailSender.SendEmailAsync(email, "Reset your password", $"Please reset your password using the following code: {resetCode}. If you didn't request a password reset, you can ignore this email."); }