Class NotificationService
Inheritance
System.Object
Assembly: cs.temp.dll.dll
Syntax
public class NotificationService : INotificationService
Constructors
NotificationService(IScopeProvider, IUserService, IContentService, ILocalizationService, ILogger<NotificationService>, IIOHelper, INotificationsRepository, IOptions<GlobalSettings>, IOptions<ContentSettings>, IEmailSender)
Declaration
public NotificationService(IScopeProvider provider, IUserService userService, IContentService contentService, ILocalizationService localizationService, ILogger<NotificationService> logger, IIOHelper ioHelper, INotificationsRepository notificationsRepository, IOptions<GlobalSettings> globalSettings, IOptions<ContentSettings> contentSettings, IEmailSender emailSender)
Parameters
Type |
Name |
Description |
IScopeProvider |
provider |
|
IUserService |
userService |
|
IContentService |
contentService |
|
ILocalizationService |
localizationService |
|
ILogger<NotificationService> |
logger |
|
IIOHelper |
ioHelper |
|
INotificationsRepository |
notificationsRepository |
|
IOptions<GlobalSettings> |
globalSettings |
|
IOptions<ContentSettings> |
contentSettings |
|
IEmailSender |
emailSender |
|
Methods
CreateNotification(IUser, IEntity, String)
Creates a new notification
Declaration
public Notification CreateNotification(IUser user, IEntity entity, string action)
Parameters
Type |
Name |
Description |
IUser |
user |
|
IEntity |
entity |
|
System.String |
action |
The action letter - note: this is a string for future compatibility
|
Returns
Type |
Description |
Notification |
|
DeleteNotifications(IEntity)
Deletes notifications by entity
Declaration
public void DeleteNotifications(IEntity entity)
Parameters
Type |
Name |
Description |
IEntity |
entity |
|
DeleteNotifications(IUser)
Deletes notifications by user
Declaration
public void DeleteNotifications(IUser user)
Parameters
Type |
Name |
Description |
IUser |
user |
|
DeleteNotifications(IUser, IEntity)
Delete notifications by user and entity
Declaration
public void DeleteNotifications(IUser user, IEntity entity)
Parameters
Type |
Name |
Description |
IUser |
user |
|
IEntity |
entity |
|
FilterUserNotificationsByPath(IEnumerable<Notification>, String)
Filters a userNotifications collection by a path
Declaration
public IEnumerable<Notification> FilterUserNotificationsByPath(IEnumerable<Notification> userNotifications, string path)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<Notification> |
userNotifications |
|
System.String |
path |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<Notification> |
|
GetEntityNotifications(IEntity)
Deletes notifications by entity
Declaration
public IEnumerable<Notification> GetEntityNotifications(IEntity entity)
Parameters
Type |
Name |
Description |
IEntity |
entity |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<Notification> |
|
GetUserNotifications(IUser)
Gets the notifications for the user
Declaration
public IEnumerable<Notification> GetUserNotifications(IUser user)
Parameters
Type |
Name |
Description |
IUser |
user |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<Notification> |
|
GetUserNotifications(IUser, String)
Gets the notifications for the user based on the specified node path
Declaration
public IEnumerable<Notification> GetUserNotifications(IUser user, string path)
Parameters
Type |
Name |
Description |
IUser |
user |
|
System.String |
path |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<Notification> |
|
SendNotifications(IUser, IEnumerable<IContent>, String, String, Uri, Func<(IUser user, NotificationEmailSubjectParams subject), String>, Func<(IUser user, NotificationEmailBodyParams body, Boolean isHtml), String>)
Sends the notifications for the specified user regarding the specified node and action.
Declaration
public void SendNotifications(IUser operatingUser, IEnumerable<IContent> entities, string action, string actionName, Uri siteUri, Func<(IUser user, NotificationEmailSubjectParams subject), string> createSubject, Func<(IUser user, NotificationEmailBodyParams body, bool isHtml), string> createBody)
Parameters
Type |
Name |
Description |
IUser |
operatingUser |
|
System.Collections.Generic.IEnumerable<IContent> |
entities |
|
System.String |
action |
|
System.String |
actionName |
|
System.Uri |
siteUri |
|
System.Func<System.ValueTuple<IUser, NotificationEmailSubjectParams>, System.String> |
createSubject |
|
System.Func<System.ValueTuple<IUser, NotificationEmailBodyParams, System.Boolean>, System.String> |
createBody |
|
SetNotifications(IUser, IEntity, String[])
Sets the specific notifications for the user and entity
Declaration
public IEnumerable<Notification> SetNotifications(IUser user, IEntity entity, string[] actions)
Parameters
Type |
Name |
Description |
IUser |
user |
|
IEntity |
entity |
|
System.String[] |
actions |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<Notification> |
|