---
title: "Interface INotificationsClient"
slug: "sdk--stylelabs.m.sdk.clients.inotificationsclient"
abstract: ""
---
# Interface INotificationsClient

Contains functionality to manage and send notifications.

## Namespace: StylelabsStylelabs.MSdkClients

## Assembly: Stylelabs.M.Sdk.dll

## Syntax

```csharp
public interface INotificationsClient
```

## Methods

### GetMailTemplateAsync(string, IEntityLoadConfiguration)

Gets an mail template entity by name.

#### Declaration

```csharp
Task<IMailTemplate> GetMailTemplateAsync(string name, IEntityLoadConfiguration loadConfiguration = null)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| string | name | Name of the mail template. |
| [IEntityLoadConfiguration](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.framework.essentials.loadconfigurations.ientityloadconfiguration.html) | loadConfiguration | The load configuration. |

#### Returns

| Type | Description |
| --- | --- |
| Task<>[IMailTemplate](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.notifications.imailtemplate.html) | The mail template entity or null if it does not exist. |

### GetMailTemplateEntitiesAsync(IEnumerable<string>, IEntityLoadConfiguration)

Gets mail template entities by name. The result can have a different ordering and size (when entities don't exist) than the input.

#### Declaration

```csharp
Task<IList<IMailTemplateEntity>> GetMailTemplateEntitiesAsync(IEnumerable<string> names, IEntityLoadConfiguration loadConfiguration = null)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| IEnumerable<>string | names | Names of the mail templates. |
| [IEntityLoadConfiguration](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.framework.essentials.loadconfigurations.ientityloadconfiguration.html) | loadConfiguration | The load configuration. |

#### Returns

| Type | Description |
| --- | --- |
| Task<>IList<>[IMailTemplateEntity](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.models.typed.imailtemplateentity.html) | The mail template entities. Can contain null when a mail template was not found. |

### GetMailTemplateEntityAsync(string, IEntityLoadConfiguration)

Gets an mail template entity by name.

#### Declaration

```csharp
Task<IMailTemplateEntity> GetMailTemplateEntityAsync(string name, IEntityLoadConfiguration loadConfiguration = null)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| string | name | Name of the mail template. |
| [IEntityLoadConfiguration](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.framework.essentials.loadconfigurations.ientityloadconfiguration.html) | loadConfiguration | The load configuration. |

#### Returns

| Type | Description |
| --- | --- |
| Task<>[IMailTemplateEntity](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.models.typed.imailtemplateentity.html) | The mail template entity or null if it does not exist. |

### GetMailTemplatesAsync(IEnumerable<string>, IEntityLoadConfiguration)

Gets mail template entities by name. The result can have a different ordering and size (when entities don't exist) than the input.

#### Declaration

```csharp
Task<IList<IMailTemplate>> GetMailTemplatesAsync(IEnumerable<string> names, IEntityLoadConfiguration loadConfiguration = null)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| IEnumerable<>string | names | Names of the mail templates. |
| [IEntityLoadConfiguration](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.framework.essentials.loadconfigurations.ientityloadconfiguration.html) | loadConfiguration | The load configuration. |

#### Returns

| Type | Description |
| --- | --- |
| Task<>IList<>[IMailTemplate](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.notifications.imailtemplate.html) | The mail template entities. Can contain null when a mail template was not found. |

### SendConfirmationEmailAsync(IEnumerable<long>)

Sends a registration confirmation e-mail to the specified users by id.

#### Declaration

```csharp
Task SendConfirmationEmailAsync(IEnumerable<long> userIds)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| IEnumerable<>long | userIds | Users that will receive the registration confirmation e-mail. |

#### Returns

| Type | Description |
| --- | --- |
| Task | An awaitable . |

#### Remarks

This action requires the 'SendConfirmationEmail' privilege.

### SendConfirmationEmailAsync(IEnumerable<string>)

Sends a registration confirmation e-mail to the specified users by username.

#### Declaration

```csharp
Task SendConfirmationEmailAsync(IEnumerable<string> usernames)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| IEnumerable<>string | usernames | Users that will receive the registration confirmation e-mail. |

#### Returns

| Type | Description |
| --- | --- |
| Task | An awaitable . |

#### Remarks

This action requires the 'SendConfirmationEmail' privilege.

### SendConfirmationEmailAsync(long)

Sends a registration confirmation e-mail to the specified user by id.

#### Declaration

```csharp
Task SendConfirmationEmailAsync(long userId)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| long | userId | User that will receive the registration confirmation e-mail. |

#### Returns

| Type | Description |
| --- | --- |
| Task | An awaitable . |

#### Remarks

This action requires the 'SendConfirmationEmail' privilege.

### SendConfirmationEmailAsync(params long\[\])

Sends a registration confirmation e-mail to the specified users by id.

#### Declaration

```csharp
Task SendConfirmationEmailAsync(params long[] userIds)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| long | userIds | Users that will receive the registration confirmation e-mail. |

#### Returns

| Type | Description |
| --- | --- |
| Task | An awaitable . |

#### Remarks

This action requires the 'SendConfirmationEmail' privilege.

### SendConfirmationEmailAsync(string)

Sends a registration confirmation e-mail to the specified user by username.

#### Declaration

```csharp
Task SendConfirmationEmailAsync(string username)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| string | username | User that will receive the registration confirmation e-mail. |

#### Returns

| Type | Description |
| --- | --- |
| Task | An awaitable . |

#### Remarks

This action requires the 'SendConfirmationEmail' privilege.

### SendConfirmationEmailAsync(params string\[\])

Sends a registration confirmation e-mail to the specified users by username.

#### Declaration

```csharp
Task SendConfirmationEmailAsync(params string[] usernames)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| string | usernames | Users that will receive the registration confirmation e-mail. |

#### Returns

| Type | Description |
| --- | --- |
| Task | An awaitable . |

#### Remarks

This action requires the 'SendConfirmationEmail' privilege.

### SendEmailNotificationAsync(MailRequestBroadcast)

Sends an e-mail to all users in M.

#### Declaration

```csharp
Task SendEmailNotificationAsync(MailRequestBroadcast mailRequest)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| [MailRequestBroadcast](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.models.notifications.mailrequestbroadcast.html) | mailRequest | Mail request information. |

#### Returns

| Type | Description |
| --- | --- |
| Task | An awaitable . |

#### Exceptions

| Type | Condition |
| --- | --- |
| [ValidationException](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.exceptions.validationexception.html) | When `mailRequest` has invalid properties. |

### SendEmailNotificationAsync(MailRequestById)

Sends an e-mail to users by user id.

#### Declaration

```csharp
Task SendEmailNotificationAsync(MailRequestById mailRequest)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| [MailRequestById](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.models.notifications.mailrequestbyid.html) | mailRequest | Mail request information. |

#### Returns

| Type | Description |
| --- | --- |
| Task | An awaitable . |

#### Exceptions

| Type | Condition |
| --- | --- |
| [ValidationException](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.exceptions.validationexception.html) | When `mailRequest` has invalid properties. |

### SendEmailNotificationAsync(MailRequestByUsername)

Sends an e-mail to users by username.

#### Declaration

```csharp
Task SendEmailNotificationAsync(MailRequestByUsername mailRequest)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| [MailRequestByUsername](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.models.notifications.mailrequestbyusername.html) | mailRequest | Mail request information. |

#### Returns

| Type | Description |
| --- | --- |
| Task | An awaitable . |

#### Exceptions

| Type | Condition |
| --- | --- |
| [ValidationException](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.exceptions.validationexception.html) | When `mailRequest` has invalid properties. |

### SendRealTimeNotificationAsync(RealtimeRequestBroadcast)

Sends a real-time notification (browser notification) to all users in M.

#### Declaration

```csharp
Task SendRealTimeNotificationAsync(RealtimeRequestBroadcast realtimeRequest)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| [RealtimeRequestBroadcast](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.models.notifications.realtimerequestbroadcast.html) | realtimeRequest | Real-time request information. |

#### Returns

| Type | Description |
| --- | --- |
| Task | An awaitable . |

#### Exceptions

| Type | Condition |
| --- | --- |
| [ValidationException](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.exceptions.validationexception.html) | When `realtimeRequest` has invalid properties. |

### SendRealTimeNotificationAsync(RealtimeRequestById)

Sends a real-time notification (browser notification) to users by user id.

#### Declaration

```csharp
Task SendRealTimeNotificationAsync(RealtimeRequestById realtimeRequest)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| [RealtimeRequestById](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.models.notifications.realtimerequestbyid.html) | realtimeRequest | Real-time request information. |

#### Returns

| Type | Description |
| --- | --- |
| Task | An awaitable . |

#### Exceptions

| Type | Condition |
| --- | --- |
| [ValidationException](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.exceptions.validationexception.html) | When `realtimeRequest` has invalid properties. |

### SendRealTimeNotificationAsync(RealtimeRequestByUsername)

Sends a real-time notification (browser notification) to users by username.

#### Declaration

```csharp
Task SendRealTimeNotificationAsync(RealtimeRequestByUsername realtimeRequest)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| [RealtimeRequestByUsername](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.models.notifications.realtimerequestbyusername.html) | realtimeRequest | Real-time request information. |

#### Returns

| Type | Description |
| --- | --- |
| Task | An awaitable . |

#### Exceptions

| Type | Condition |
| --- | --- |
| [ValidationException](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.exceptions.validationexception.html) | When `realtimeRequest` has invalid properties. |
