• Share
    • Twitter
    • LinkedIn
    • Facebook
    • Email
  • Feedback
  • Improve this Doc

Interface INotificationsController

Defines the methods to work with Notifications, NotificationTypes, NotificationTypeActions and NotificationActions.

Namespace: DotNetNuke.Services.Social.Notifications
Assembly: DotNetNuke.dll
Syntax
public interface INotificationsController

Methods

| Improve this Doc View Source

CountNotifications(Int32, Int32)

Counts the notifications sent to the provided user in the specified portal.

Declaration
int CountNotifications(int userId, int portalId)
Parameters
Type Name Description
System.Int32 userId

The user identifier.

System.Int32 portalId

The portal identifier.

Returns
Type Description
System.Int32

The number of notifications sent to the provided user in the specified portal.

| Improve this Doc View Source

CreateNotificationType(NotificationType)

Creates a new notification type.

Declaration
void CreateNotificationType(NotificationType notificationType)
Parameters
Type Name Description
NotificationType notificationType
| Improve this Doc View Source

DeleteAllNotificationRecipients(Int32)

Deletes all NotificationRecipient for the NotificationId.

Declaration
void DeleteAllNotificationRecipients(int notificationId)
Parameters
Type Name Description
System.Int32 notificationId

The notification identifier.

Remarks

It also deletes the notification.

| Improve this Doc View Source

DeleteNotification(Int32)

Deletes an existing notification.

Declaration
void DeleteNotification(int notificationId)
Parameters
Type Name Description
System.Int32 notificationId

The notification identifier.

Remarks

It does not delete NotificationRecipient.

| Improve this Doc View Source

DeleteNotificationRecipient(Int32, Int32)

Deletes an individual notification recipient.

Declaration
void DeleteNotificationRecipient(int notificationId, int userId)
Parameters
Type Name Description
System.Int32 notificationId

The notification identifier.

System.Int32 userId

The user identifier.

Remarks

It also deletes the notification if there are no more recipients.

| Improve this Doc View Source

DeleteNotificationRecipient(Int32, String, Int32)

Deletes an individual notification recipient based on NotificationTypeId, Context and UserId.

Declaration
void DeleteNotificationRecipient(int notificationTypeId, string context, int userId)
Parameters
Type Name Description
System.Int32 notificationTypeId

Id of the notification type.

System.String context

Context set by creator of the notification.

System.Int32 userId

The user identifier.

Remarks

It also deletes the notification if there are no more recipients.

| Improve this Doc View Source

DeleteNotificationType(Int32)

Deletes an existing notification type.

Declaration
void DeleteNotificationType(int notificationTypeId)
Parameters
Type Name Description
System.Int32 notificationTypeId

The notification type identifier.

| Improve this Doc View Source

DeleteNotificationTypeAction(Int32)

Deletes an existing notification type action.

Declaration
void DeleteNotificationTypeAction(int notificationTypeActionId)
Parameters
Type Name Description
System.Int32 notificationTypeActionId

The notification type action identifier.

| Improve this Doc View Source

DeleteUserNotifications(UserInfo)

Deletes all user notifications in a specific portal.

Declaration
int DeleteUserNotifications(UserInfo user)
Parameters
Type Name Description
UserInfo user

The user to delete notifications for.

Returns
Type Description
System.Int32

Number of deleted notifications.

| Improve this Doc View Source

GetNotification(Int32)

Get a Notification.

Declaration
Notification GetNotification(int notificationId)
Parameters
Type Name Description
System.Int32 notificationId

The notificationId.

Returns
Type Description
Notification

A notification.

| Improve this Doc View Source

GetNotificationByContext(Int32, String)

Get a Notification by NotificationTypeId and Context.

Declaration
IList<Notification> GetNotificationByContext(int notificationTypeId, string context)
Parameters
Type Name Description
System.Int32 notificationTypeId

Id of the notification type.

System.String context

Context set by creator of the notification.

Returns
Type Description
IList<Notification>

The filtered list of notifications sent to the provided user in the specified portal.

| Improve this Doc View Source

GetNotifications(Int32, Int32, Int32, Int32)

Gets a list of notifications sent to the provided user in the specified portal.

Declaration
IList<Notification> GetNotifications(int userId, int portalId, int afterNotificationId, int numberOfRecords)
Parameters
Type Name Description
System.Int32 userId

The user identifier.

System.Int32 portalId

The portal identifier.

System.Int32 afterNotificationId

The notification identifier of the last notification displayed. Use -1 to start from the beggining of the list.

System.Int32 numberOfRecords

The number of results to retrieve.

Returns
Type Description
IList<Notification>

The filtered list of notifications sent to the provided user in the specified portal.

Examples

For example, if we have the following ordered notification identifiers: 4, 6, 2, 12, 45, and we pass 2 as the afterNotificationId and 2 as the numberOfRecords, the method will return the notifications 12 and 45.

| Improve this Doc View Source

GetNotificationType(Int32)

Gets a notification type by identifier.

Declaration
NotificationType GetNotificationType(int notificationTypeId)
Parameters
Type Name Description
System.Int32 notificationTypeId

The notification type identifier.

Returns
Type Description
NotificationType

The notification type with the provided identifier.

| Improve this Doc View Source

GetNotificationType(String)

Gets a notification type by name.

Declaration
NotificationType GetNotificationType(string name)
Parameters
Type Name Description
System.String name

The notification type name.

Returns
Type Description
NotificationType

The notification type with the provided name.

| Improve this Doc View Source

GetNotificationTypeAction(Int32, String)

Gets a notification type action by notification type and name.

Declaration
NotificationTypeAction GetNotificationTypeAction(int notificationTypeId, string name)
Parameters
Type Name Description
System.Int32 notificationTypeId

The notification type identifier.

System.String name

The notification type action name.

Returns
Type Description
NotificationTypeAction

The notification type action with the provided notification type and name.

| Improve this Doc View Source

GetNotificationTypeAction(Int32)

Gets a notification type action by identifier.

Declaration
NotificationTypeAction GetNotificationTypeAction(int notificationTypeActionId)
Parameters
Type Name Description
System.Int32 notificationTypeActionId

The notification type action identifier.

Returns
Type Description
NotificationTypeAction

The notification type action with the provided identifier.

| Improve this Doc View Source

GetNotificationTypeActions(Int32)

Gets the list of notification type actions for the provided notification type.

Declaration
IList<NotificationTypeAction> GetNotificationTypeActions(int notificationTypeId)
Parameters
Type Name Description
System.Int32 notificationTypeId

The notification type identifier.

Returns
Type Description
IList<NotificationTypeAction>

An ordered list of notification type actions for the provided notification type.

| Improve this Doc View Source

GetToasts(UserInfo)

Get a list of Toasts that have not been delivered yet.

Declaration
IList<Notification> GetToasts(UserInfo userInfo)
Parameters
Type Name Description
UserInfo userInfo

UserInfo object.

Returns
Type Description
IList<Notification>

List of Undelivered Toasts for the user specific to the portal.

| Improve this Doc View Source

IsToastPending(Int32)

Is there a Toast that needs to be sent for a Notification.

Declaration
bool IsToastPending(int notificationId)
Parameters
Type Name Description
System.Int32 notificationId

The Notification Id.

Returns
Type Description
System.Boolean

True if Toast needs to be sent. False otherwise.

| Improve this Doc View Source

MarkReadyForToast(Notification, UserInfo)

Mark a Toast ready for sending.

Declaration
void MarkReadyForToast(Notification notification, UserInfo userInfo)
Parameters
Type Name Description
Notification notification

The notification Object.

UserInfo userInfo

The Recipient User Info Object.

| Improve this Doc View Source

MarkToastSent(Int32, Int32)

Mark Toast being already sent.

Declaration
void MarkToastSent(int notificationId, int userId)
Parameters
Type Name Description
System.Int32 notificationId

The notification Id.

System.Int32 userId

The Recipient User Id.

| Improve this Doc View Source

SendNotification(Notification, Int32, IList<RoleInfo>, IList<UserInfo>)

Creates a new notification and sets is sender as the portal administrator.

Declaration
void SendNotification(Notification notification, int portalId, IList<RoleInfo> roles, IList<UserInfo> users)
Parameters
Type Name Description
Notification notification

The notification.

System.Int32 portalId

The portalId.

IList<RoleInfo> roles

The list of roles to send the notification to. Leave it as null to send only to individual users.

IList<UserInfo> users

The list of users to send the notification to. Leave it as null to send only to roles.

| Improve this Doc View Source

SetNotificationTypeActions(IList<NotificationTypeAction>, Int32)

Set the actions for a NotificationType.

Declaration
void SetNotificationTypeActions(IList<NotificationTypeAction> actions, int notificationTypeId)
Parameters
Type Name Description
IList<NotificationTypeAction> actions

The actions.

System.Int32 notificationTypeId

Id of the notification type.

Extension Methods

JsonExtensionsWeb.ToJson(Object)
  • View Source
Back to top by the community, for the community... #DNNCMS