void ForumService_Created(object sender, ForumEventArgs e) { var content = ApplicationContext.Current.Services.ContentService.GetById(e.Forum.ParentId); if (content.ContentType.Alias == "Project") { var owner = content.GetValue<int>("owner"); //NotificationsWeb.BusinessLogic.Forum.Subscribe(e.Forum.Id, owner); var ns = new NotificationService(ApplicationContext.Current.DatabaseContext); ns.SubscribeToForum(e.Forum.Id, owner); } }
void TopicService_Created(object sender, TopicEventArgs e) { var ns = new NotificationService(ApplicationContext.Current.DatabaseContext); ns.SubscribeToForumTopic(e.Topic.Id, e.Topic.MemberId); //send notification InstantNotification not = new InstantNotification(); //data for notification: var membershipHelper = new MembershipHelper(Umbraco.Web.UmbracoContext.Current); var member = membershipHelper.GetById(e.Topic.MemberId); var memberName = string.Empty; if (member != null) memberName = member.Name; not.Invoke(Config.ConfigurationFile, Config.AssemblyDir, "NewTopic", e.Topic, e.Topic.GetUrl(), memberName); }
public NotificationsController() { _notificationService = new NotificationService(DatabaseContext); }
void ForumService_Deleted(object sender, ForumEventArgs e) { var ns = new NotificationService(ApplicationContext.Current.DatabaseContext); ns.RemoveAllForumSubscriptions(e.Forum.Id); }