Try Now
More in this section

Forums / General Discussions / send alert email

send alert email

2 posts, 0 answered
  1. Stephen
    Stephen avatar
    70 posts
    09 Jun 2009
    17 Sep 2009
    Link to this post
    Is it possible to send email alert automatically to all subscribers when news are updated or added? Thanks.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    19 Oct 2016
    17 Sep 2009
    Link to this post
    Hello Developer,

    You can add the logic below to yoru Globa.asax file.

        void Application_Start(object sender, EventArgs e)  
            // Code that runs on application startup 
            Telerik.Cms.Engine.ContentManager.Executed += new EventHandler<Telerik.ExecutedEventArgs>(ContentManager_Executed); 
    void ContentManager_Executed(object sender, Telerik.ExecutedEventArgs e) 
        var manager = new Telerik.News.NewsManager("News"); 
        if (e.CommandName == "CreateContent" || e.CommandName == "UpdateContent" && manager.Content.Provider.Name == "News"
            Telerik.Notifications.Newsletters.DataManager dManager = new Telerik.Notifications.Newsletters.DataManager(); 
            IList allSubscribers = dManager.GetSubscribers(); 
            foreach (Telerik.Newsletters.ISubscriber sub in allSubscribers) 
                Telerik.Notifications.Newsletters.NewsletterManager nManager = new Telerik.Notifications.Newsletters.NewsletterManager(); 
                Telerik.Notifications.Newsletters.NewsletterManager.SendEmail([toList, body, ssubject, senderName, senderAddress); 

    I hope this helps.

    Kind regards,
    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.
2 posts, 0 answered