/
githubmirror
/
aspnetcore
Обзор
Документация
Войти
/
githubmirror
/
aspnetcore
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Security/samples/Identity.ExternalClaims/Extensions/EmailSenderExtensions.cs
26 строк
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 System; using System.Collections.Generic; using System.Linq; using System.Text.Encodings.Web; using System.Threading.Tasks; using Identity.ExternalClaims.Services; namespace Identity.ExternalClaims.Services; public static class EmailSenderExtensions { public static Task SendEmailConfirmationAsync(this IEmailSender emailSender, string email, string link) { return emailSender.SendEmailAsync(email, "Confirm your email", $"Please confirm your account by <a href='{HtmlEncoder.Default.Encode(link)}'>clicking here</a>. If you didn't request this email confirmation, you can ignore this email."); } public static Task SendResetPasswordAsync(this IEmailSender emailSender, string email, string callbackUrl) { return emailSender.SendEmailAsync(email, "Reset Password", $"Please reset your password by <a href='{HtmlEncoder.Default.Encode(callbackUrl)}'>clicking here</a>. If you didn't request a password reset, you can ignore this email."); } }