More in this section
Forums / Suggestions / How to add a User to all subscriber groups at a time

How to add a User to all subscriber groups at a time

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. Venkat
    Venkat avatar
    105 posts
    20 Nov 2008
    16 Jun 2009
    Link to this post

    In our site, we want to add the non CMS user to more than one subscriber group at a time using Subscription form.

    Currently Subscription form containing the fields Name and Email ID only.

    our requirement is to display all subscriber groups as the check boxes.

    When the user presses Submit button the will be subscribed to all groups that he selected.How can we do this?

    On the admin side if I want to add a non CMS user to more than one group, I have to go each and every group and add this user ,But we want to change this to

    When the user presses the edit button on any subscriber list item, He should be
    able to subscribe to any number of groups.But Sitefinity allowing to change Email and Name only.We want to add all  subscription groups as the check boxes. after submitting the button the user should be added to all the groups that he selected.

    Thank you
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    12 Sep 2017
    17 Jun 2009
    Link to this post
    Hi Venkat,

    You can modify SubscribersTemplate.ascx template under Sitefinity/Admin/Notifications folder and add CheckBoxList control or Repeater control. Then you can use DataManager class and get the list of the groups you have using manager.GetGroups() methood. Then foreach group create a ListItem and add Group name and ID.

                       foreach (IGroup group in listofGroups) 
                    ListItem item = new ListItem(group.GroupName, group.GroupId.ToString()); 

    Then get the ID of email TextBox and set the subscriber

    Sample code:

    DataManager manager2 = new DataManager(); 
    ISubscriber newsubscriber = manager2.CreateSubscriber(SubscriberEmail.Text); 

    Then you can save the subscriber using SaveSubscriber method. To add a subscriber to one of the groups you should check whether the checkbox is checked and then use CreateGroupSubscriberRelation();

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