Class EmailUserInviteSender
Provides functionality to send email invitations to users, typically for onboarding or granting access to the system.
Inheritance
Namespace: Umbraco.Cms.Infrastructure.Security
Assembly: Umbraco.Infrastructure.dll
Syntax
public class EmailUserInviteSender : IUserInviteSender
Constructors
View SourceEmailUserInviteSender(IEmailSender, ILocalizedTextService, IOptions<GlobalSettings>)
Initializes a new instance of the EmailUserInviteSender class.
Declaration
[Obsolete("Please use the constructor with all parameters. Scheduled for removal in Umbraco 18.")]
public EmailUserInviteSender(IEmailSender emailSender, ILocalizedTextService localizedTextService, IOptions<GlobalSettings> globalSettings)
Parameters
| Type | Name | Description |
|---|---|---|
| IEmailSender | emailSender | Service used to send emails. |
| ILocalizedTextService | localizedTextService | Service for retrieving localized strings. |
| IOptions<GlobalSettings> | globalSettings | The global settings options. |
EmailUserInviteSender(IEmailSender, ILocalizedTextService, IOptions<GlobalSettings>, IOptions<SecuritySettings>)
Initializes a new instance of the EmailUserInviteSender class with the specified dependencies.
Declaration
public EmailUserInviteSender(IEmailSender emailSender, ILocalizedTextService localizedTextService, IOptions<GlobalSettings> globalSettings, IOptions<SecuritySettings> securitySettings)
Parameters
| Type | Name | Description |
|---|---|---|
| IEmailSender | emailSender | The service used to send emails. |
| ILocalizedTextService | localizedTextService | The service used for retrieving localized text. |
| IOptions<GlobalSettings> | globalSettings | The global settings options. |
| IOptions<SecuritySettings> | securitySettings | The security settings options. |
Methods
View SourceCanSendInvites()
Determines whether the system can send user invite emails.
Declaration
public bool CanSendInvites()
Returns
| Type | Description |
|---|---|
| bool |
|
InviteUser(UserInvitationMessage)
Asynchronously sends an invitation email to a user using the details provided in the invite parameter.
Declaration
public Task InviteUser(UserInvitationMessage invite)
Parameters
| Type | Name | Description |
|---|---|---|
| UserInvitationMessage | invite | A UserInvitationMessage containing the recipient, sender, invitation message, and invitation URI. |
Returns
| Type | Description |
|---|---|
| Task | A System.Threading.Tasks.Task representing the asynchronous operation of sending the invitation email. |