using Microsoft.AspNetCore.Identity; namespace Indotalent.Infrastructure.Email; public class IdentityEmailManager : IEmailSender where TUser : class { private readonly IEmailSender _emailSender; public IdentityEmailManager(IEmailSender emailSender) { _emailSender = emailSender; } public Task SendConfirmationLinkAsync(TUser user, string email, string confirmationLink) { var message = confirmationLink.Contains("<") ? confirmationLink : $"Please confirm your account by clicking this link: Confirm Account"; return _emailSender.SendEmailAsync(email, "Account Confirmation", message); } public Task SendPasswordResetLinkAsync(TUser user, string email, string resetLink) { var message = resetLink.Contains("<") ? resetLink : $"To reset your password, please click the following link: Reset Password"; return _emailSender.SendEmailAsync(email, "Password Reset Request", message); } public Task SendPasswordResetCodeAsync(TUser user, string email, string resetCode) => _emailSender.SendEmailAsync(email, "Your Password Reset Code", $"Your password reset security code is: {resetCode}. Please enter this code to proceed with the reset process."); }