Class EmailUserForgotPasswordSender
Provides functionality to send password reset emails to users who have requested a password reset.
Inheritance
Namespace: Umbraco.Cms.Infrastructure.Security
Assembly: Umbraco.Infrastructure.dll
Syntax
public class EmailUserForgotPasswordSender : IUserForgotPasswordSender
Constructors
View SourceEmailUserForgotPasswordSender(IEmailSender, ILocalizedTextService, IOptionsMonitor<GlobalSettings>, IOptionsMonitor<SecuritySettings>)
Initializes a new instance of the EmailUserForgotPasswordSender class.
Declaration
public EmailUserForgotPasswordSender(IEmailSender emailSender, ILocalizedTextService localizedTextService, IOptionsMonitor<GlobalSettings> globalSettings, IOptionsMonitor<SecuritySettings> securitySettings)
Parameters
| Type | Name | Description |
|---|---|---|
| IEmailSender | emailSender | An implementation of IEmailSender used to send emails. |
| ILocalizedTextService | localizedTextService | An implementation of ILocalizedTextService for retrieving localized text resources. |
| IOptionsMonitor<GlobalSettings> | globalSettings | A monitor for GlobalSettings providing application-wide configuration values. |
| IOptionsMonitor<SecuritySettings> | securitySettings | A monitor for SecuritySettings providing security-related configuration values. |
Methods
View SourceCanSend()
Determines whether a forgot password email can be sent, based on the current security settings and the email sender's capability to send required emails.
Declaration
public bool CanSend()
Returns
| Type | Description |
|---|---|
| bool |
|
SendForgotPassword(UserForgotPasswordMessage)
Asynchronously sends a password reset email to the user specified in the provided message model.
Declaration
public Task SendForgotPassword(UserForgotPasswordMessage messageModel)
Parameters
| Type | Name | Description |
|---|---|---|
| UserForgotPasswordMessage | messageModel | The message model containing information about the recipient and the password reset link. |
Returns
| Type | Description |
|---|---|
| Task | A System.Threading.Tasks.Task that represents the asynchronous send operation. |