Class IdentityNoOpEmailSender<TUser>
- Namespace
- Stratara.Identity.AspNetCore.Services
- Assembly
- Stratara.Identity.AspNetCore.dll
Development-time IEmailSender<TUser> that silently drops every email (returns CompletedTask without sending anything).
public sealed class IdentityNoOpEmailSender<TUser> : IEmailSender<TUser> where TUser : class, new()
Type Parameters
TUserThe ASP.NET Core Identity user type.
- Inheritance
-
IdentityNoOpEmailSender<TUser>
- Implements
-
IEmailSender<TUser>
- Inherited Members
- Extension Methods
Remarks
Never register this in production. Use
AddDevelopmentNoOpEmailSender<TUser> on the host builder
to wire it via DI — that extension throws when the host environment is Production.
In production register a real IEmailSender<TUser> implementation (e.g. SendGrid, Mailgun, AWS SES) instead.
Methods
SendConfirmationLinkAsync(TUser, string, string)
Drops a confirmation-link email.
public Task SendConfirmationLinkAsync(TUser user, string email, string confirmationLink)
Parameters
userTUserThe identity user.
emailstringRecipient email address.
confirmationLinkstringAbsolute URL that confirms the account when visited.
Returns
SendPasswordResetCodeAsync(TUser, string, string)
Drops a password-reset-code email.
public Task SendPasswordResetCodeAsync(TUser user, string email, string resetCode)
Parameters
userTUserThe identity user.
emailstringRecipient email address.
resetCodestringThe reset code to display to the user.
Returns
SendPasswordResetLinkAsync(TUser, string, string)
Drops a password-reset-link email.
public Task SendPasswordResetLinkAsync(TUser user, string email, string resetLink)
Parameters
userTUserThe identity user.
emailstringRecipient email address.
resetLinkstringAbsolute URL that opens the password-reset flow when visited.