More in this section


The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
2 posts, 0 answered
  1. rmoynihan
    rmoynihan avatar
    18 posts
    28 May 2007
    28 Sep 2008
    Link to this post

    I am creating a page which contains a checkbox which the user can tick to subscribe for the newsletter. How do I add the user to a newsltter group using the api.


  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    12 Sep 2017
    01 Oct 2008
    Link to this post
    Hello Ronan,

    Thank you for contacting us.

    Newsletter API is described in our Developer Manaual. Also, we have prepared a simple example for you that illustrates how to achieve the desired implementation:

    using System; 
    using System.Collections; 
    using System.Web.Security; 
    using Telerik.Newsletters; 
    using Telerik.Notifications.Newsletters; 
    namespace Custom 
        public class NewsletterHelper 
            /// <summary> 
            /// </summary> 
            /// <param name="newsletterID">The ID of the newsletter you want to subscribe the current user to</param> 
            public void SubscribeCurrentUserToNewsletter(Guid newsletterID) 
                // Get a MembershipUser object of the currently logged-on user 
                MembershipUser user = Membership.GetUser(); 
                if (user != null
                    // Create an instance of Newsletter manager 
                    DataManager manager = new DataManager(); 
                    // Get the ISubscriber object by user email  
                    ISubscriber subscriber = manager.GetSubscriber(user.Email); 
                    if (subscriber == null
                        // Create the subscriber if he/she does exists 
                        subscriber = manager.CreateSubscriber(user.Email); 
                    // Get the collection of the Newsletter groups 
                    IList groups = manager.GetGroupOfNewsletter(newsletterID); 
                    IGroup group = null
                    // For example we need the first group in the collection 
                    if (groups.Count > 0) 
                        group = (IGroup)groups[0]; 
                    if (group != null
                        // Subscribe the user to the group and save 
                        IGroupSubscriber groupSubscriber = manager.CreateGroupSubscriberRelation(group.GroupId, subscriber.SubscriberId); 

    Hope this helps.

    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
2 posts, 0 answered