November Happy Hour will be moved to Thursday December 5th.

Interface ISubscriptionService

Class for handling Notification Subscriptions

Namespace: EPiServer.Notification
Assembly: EPiServer.dll
Version: 11.20.7
Syntax
public interface ISubscriptionService

Methods

ClearSubscriptionAsync(Uri)

Clears(deletes) all subscriptions found under a Subscription key. Note that this is recursive and includes all Subscriptions starting with the key.

Declaration
Task ClearSubscriptionAsync(Uri subscriptionKey)
Parameters
Type Name Description
System.Uri subscriptionKey

The Subscription to clear

Returns
Type Description
System.Threading.Tasks.Task

ClearUserAsync(INotificationUser)

Clears(deletes) all subscriptions for a user.

Declaration
Task ClearUserAsync(INotificationUser user)
Parameters
Type Name Description
INotificationUser user

The user to clear

Returns
Type Description
System.Threading.Tasks.Task

FindSubscribersAsync(Uri)

Finds all users that has subscriptions that matches the subscription key. The method will make partially matches. It will return the subscribers that subscribes to a parent segment (part of the uri delimited by slashes) of the key.

Declaration
Task<IEnumerable<INotificationUser>> FindSubscribersAsync(Uri subscriptionKey)
Parameters
Type Name Description
System.Uri subscriptionKey

The key of a Subscription or a part of one

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<INotificationUser>>

List of users

ListSubscribersAsync(Uri)

Lists the users that subcribes to the Subscription.

Declaration
Task<IEnumerable<INotificationUser>> ListSubscribersAsync(Uri subscriptionKey)
Parameters
Type Name Description
System.Uri subscriptionKey

The key of the Subscription

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<INotificationUser>>

List of users

ListSubscriptionsAsync(INotificationUser)

Lists the Subscriptions for a user.

Declaration
Task<IEnumerable<Uri>> ListSubscriptionsAsync(INotificationUser user)
Parameters
Type Name Description
INotificationUser user

The user

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<System.Uri>>

List of Subscriptions

ListSubscriptionsAsync(Uri)

Lists the Subscriptions that starts with a subscription key. Note that this is recursive and includes all Subscriptions starting with the key.

Declaration
Task<IEnumerable<Uri>> ListSubscriptionsAsync(Uri subscriptionKey)
Parameters
Type Name Description
System.Uri subscriptionKey

The key of the Subscription

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<System.Uri>>

List of Subscriptions

SubscribeAsync(Uri, INotificationUser)

Adds a Subscription for a user.

Declaration
Task SubscribeAsync(Uri subscriptionKey, INotificationUser user)
Parameters
Type Name Description
System.Uri subscriptionKey

The key of the Subscription

INotificationUser user

The user to subscribe

Returns
Type Description
System.Threading.Tasks.Task

SubscribeAsync(Uri, IEnumerable<INotificationUser>)

Adds a Subscription for a list of users.

Declaration
Task SubscribeAsync(Uri subscriptionKey, IEnumerable<INotificationUser> users)
Parameters
Type Name Description
System.Uri subscriptionKey

The key of the Subscription

System.Collections.Generic.IEnumerable<INotificationUser> users

The users to subscribe

Returns
Type Description
System.Threading.Tasks.Task

UnsubscribeAsync(Uri, INotificationUser)

Removes a Subscription for a user.

Declaration
Task UnsubscribeAsync(Uri subscriptionKey, INotificationUser user)
Parameters
Type Name Description
System.Uri subscriptionKey

The key of the Subscription

INotificationUser user

The user to unsubscribe

Returns
Type Description
System.Threading.Tasks.Task

UnsubscribeAsync(Uri, IEnumerable<INotificationUser>)

Removes a Subscription for a list of users.

Declaration
Task UnsubscribeAsync(Uri subscriptionKey, IEnumerable<INotificationUser> users)
Parameters
Type Name Description
System.Uri subscriptionKey

The key of the Subscription

System.Collections.Generic.IEnumerable<INotificationUser> users

The users to unsubscribe

Returns
Type Description
System.Threading.Tasks.Task

Events

SubscriptionCleared

Occurs when a ClearSubscription is made for a subscription.

Declaration
event EventHandler<SubscriptionClearedEventArgs> SubscriptionCleared
Event Type
Type Description
System.EventHandler<SubscriptionClearedEventArgs>

UserCleared

Occurs when a ClearUser is made for a user.

Declaration
event EventHandler<UserClearedEventArgs> UserCleared
Event Type
Type Description
System.EventHandler<UserClearedEventArgs>

UserSubscribed

Occurs when a subscription is made for a user.

Declaration
event EventHandler<SubscriptionEventArgs> UserSubscribed
Event Type
Type Description
System.EventHandler<SubscriptionEventArgs>

UserUnsubscribed

Occurs when an unsubscription is made for a user.

Declaration
event EventHandler<SubscriptionEventArgs> UserUnsubscribed
Event Type
Type Description
System.EventHandler<SubscriptionEventArgs>

Extension Methods