+1-888-365-2779
Try Now
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

2 posts, 0 answered
  1. Venkat
    Venkat avatar
    105 posts
    Registered:
    20 Nov 2008
    16 Jun 2009
    Link to this post
    Hi,

    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
    Venkat.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    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()); 
                    cbList.Items.Add(item); 
                } 

    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