Snippets
21

You can use NotificationsController.Instance.SendNotification method to send notifications.

Here is an example:

 

        public void AddHtmlNotification(string subject, string body)
        {
           
            UserInfo _currentUser = DotNetNuke.Entities.Users.UserController.GetUserById(this.PortalId, PortalSettings.AdministratorId);
            var notificationType = NotificationsController.Instance.GetNotificationType("HtmlNotification");
            // NEED THE PORTALID HERE AND AGENTID
            var sender = UserController.GetUserById(this.PortalId, this.UserId);
            var notification = new Notification { NotificationTypeID = notificationType.NotificationTypeId, Subject = subject, Body = body, IncludeDismissAction = true, SenderUserID = sender.UserID };
            NotificationsController.Instance.SendNotification(notification, this.PortalId, null, new List { _currentUser });
        }

 

Post Rating

Comments

There are currently no comments, be the first to post one!

Post Comment

Only registered users may post comments.

  120 OLD FREEMANS WAY, BREWSTER, MA 02631
  P. O. BOX 2342, BREWSTER, MA 02631
  (774) 323-3176
  CONTACT US