More in this section

Forum Email's

4 posts, 0 answered
  1. Daniel
    Daniel avatar
    62 posts
    Registered:
    20 Apr 2009
    29 Jun 2009
    Link to this post
    Hey guys

    Just wondering if there is anyway to implement some functionality for when a forum post is ready to be moderated that the administrator gets an email notification?

    Love the new site btw

    Daniel
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    29 Jun 2009
    Link to this post
    Hello Daniel,

    You can subscribe for different CommandName that is associated when a post is created or updated.

    Sample code:

     void Application_Start(object sender, EventArgs e)  
        { 
            // Code that runs on application startup 
            Telerik.Forums.ForumManager.Executing += new EventHandler<Telerik.ExecutingEventArgs>(ForumManager_Executing); 
        
        } 
      
        void ForumManager_Executing(object sender, Telerik.ExecutingEventArgs e) 
        { 
            if (e.CommandName == "UpdatePost"
            { 
                // implement email notification 
                System.Web.Mail.MailMessage message = new System.Web.Mail.MailMessage();\ 
                message.Subject = "post has been updated"
                message.To = "admin@domain.com"
                message.Body = "some body"
                System.Web.Mail.SmtpMail.Send(message); 
                 
            } 
        } 


    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Drew Peloubet
    Drew Peloubet avatar
    10 posts
    Registered:
    06 Oct 2008
    17 Jan 2010
    Link to this post
    Ivan,

    Is it possible to get the email of the current post author and original forum post author from global.asax code you provided below?

    Thanks
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    18 Jan 2010
    Link to this post
    Hi Drew Peloubet,

    You can call the post parent and post thread to get the owner from there

    if (e.CommandName == "UpdatePost")
    {
        Telerik.Forums.IPost post = (Telerik.Forums.IPost)e.CommandArguments;
        string postOwner = post.Owner;
        string threadOwner = post.Thread.Owner;
        string parentPostOwner = post.Parent.Owner;
    }


    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Register for webinar
4 posts, 0 answered