1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Newsletter Module

Newsletter Module

13 posts, 0 answered
  1. v
    v avatar
    27 posts
    Registered:
    12 Aug 2009
    10 Dec 2009
    Link to this post
    Hi,
    I'm Using sitefinity 3.7 i would like to edit the add subscriber, edit subscriber part.
    when the user is adding to the group. by that time i created my own table, there i need to insert the data.
    how do i fix this? will you give a steps please

    Thanks
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    10 Dec 2009
    Link to this post
    Hello v,

     You can create a data layer, use LINQ to SQL or make direct queries to database to save and get the data. When you add an user to a group, ~/Sitefinity/Admin/ControlTemplates/Notifications/SubscribersTemplate.ascx is used. There is a Link button with ID="addbtn". You can subscribe ~/Sitefinity/Admin/ControlTemplates/Notifications/SubscribersEditorTemplate.ascx. There is a Linkbutton contorl with ID="saveChangesbtn". You can subscribe for the "saveChangesbtn" OnClick" event and again process your data.


    All the best,
    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.
  3. v
    v avatar
    27 posts
    Registered:
    12 Aug 2009
    11 Dec 2009
    Link to this post
    Good. Thanks for the info.  for subscriber add i have done finding the group name.
    where as while editing the user info how can i find out the group please?

    Thanks


  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    11 Dec 2009
    Link to this post
    Hi v,

    Below is a sample code that you can use the get all groups in which your subscriber is added.

    DataManager dManager = new DataManager();
    ISubscriber subscriber = dManager.GetSubscriber(emailtxt);
    IList allGroups = subscriber.Groups;
    if (allGroups.Count > 0)
    {
        foreach (IGroup gr in allGroups)
        {
            Response.Write(gr.GroupName + "<br />");
        }
    }


    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.
  5. v
    v avatar
    27 posts
    Registered:
    12 Aug 2009
    11 Dec 2009
    Link to this post
    There are  4 groups. four group same email id exists.
    while adding i can see the group grpNameltl.Text, i got the group name easily..,
    where as editing the user info i could not find the group name any where!
    how do i?
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    11 Dec 2009
    Link to this post
    Hello v,

    In this case when an user belongs to several groups when you update the user data this will apply to the other instance of this user no matter of the group. The data is directly processed by the DataManager object.


    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.
  7. v
    v avatar
    27 posts
    Registered:
    12 Aug 2009
    11 Dec 2009
    Link to this post
    which the action is taken care of datamanager., i dnt have any issue(sound great).
    where im having my table which is having group id, subscriber id, fname,lname, email their also i need to update the details that's why im asking how could i handle?
  8. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    11 Dec 2009
    Link to this post
    Hello v,

    This will return the ID of each group that an user belongs to.

    foreach (IGroup gr in allGroups)
    {
        Guid gID = gr.GroupId;
    }

    Then you have to update the tables you created.


    All the best,
    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.
  9. v
    v avatar
    27 posts
    Registered:
    12 Aug 2009
    14 Dec 2009
    Link to this post
    when i use the code below

    DataManager dManager = new DataManager();
    ISubscriber subscriber = dManager.GetSubscriber(emailtxt);
    IList allGroups = subscriber.Groups;
    if (allGroups.Count > 0)
    {
        foreach (IGroup gr in allGroups)
        {
            Response.Write(gr.GroupName + "<br />");
        }
    }

    Server Error in '/' Application.

    Unable to cast object of type 'Telerik.Notifications.Data.GroupSubscriber' to type 'Telerik.Newsletters.IGroup'.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.InvalidCastException: Unable to cast object of type 'Telerik.Notifications.Data.GroupSubscriber' to type 'Telerik.Newsletters.IGroup'.

    Source Error:

    Line 33:         if (allGroups.Count > 0)
    Line 34: {
    Line 35: foreach (IGroup gr in allGroups)
    Line 36: {
    Line 37: Response.Write(gr.GroupName + "<br />");


    I made some changes
    DataManager dManager = new DataManager();
            ISubscriber subscriber = dManager.GetSubscriber(emailtxt.Text);
            IList allGroups = subscriber.Groups;
            if (allGroups.Count > 0)
            {
                foreach (IGroupSubscriber gr in allGroups)
                {
                    Response.Write(gr.GroupId + "<br />");
                    Response.Write(gr.Subscriber.Email  + "<br />");
                    Response.Write(gr.Group.GroupName + "<br />");
                }
            }


    find the jpg. - I need only the user belongs to which group?
    because the same user subscribed for another group. when i execute foreach (IGroupSubscriber gr in allGroups)
    it give the details of both group users. how can i identify the user is belongs to Group A/ Group B dynamically when edit loading page.
    Thanks


  10. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    14 Dec 2009
    Link to this post
    Hello v,

    It gives you the data for the both groups because the user is the same. If the email is the same, then the user is changed in each newsletter group from the screenshot dialog. You can pass the group as a QueryString and get it from there, but if you have two users with the same email address, they will be updated in each group.


    Greetings,
    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.
  11. Asit
    Asit avatar
    87 posts
    Registered:
    07 Nov 2009
    15 Jan 2010
    Link to this post
    Hi how can i redirect to the list page after editing any subscriber.
  12. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    15 Jan 2010
    Link to this post
    Hello asit pani,

    If you have overridden the module you may call

    ( ( CustomNewslettersControlPanel ) this.Parent ).DisplayMode = CustomNewslettersControlPanel .Display.SubscriberOfGroup;

    when SaveChangesbtn is clicked. Otherwise you can make some postback, using QueryString or Session from the previous view.

    Greetings,
    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.
  13. Asit
    Asit avatar
    87 posts
    Registered:
    07 Nov 2009
    15 Jan 2010
    Link to this post
    hi thanks for ur reply.
    But im not using the SaveChangesbtn , rather i have created a new button.

    so in btn_click i added this code u given ,bu showing the below error.



    Server Error in '/' Application.

    Compilation Error

    Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

    Compiler Error Message: CS0246: The type or namespace name 'CustomNewslettersControlPanel' could not be found (are you missing a using directive or an assembly reference?)

    Source Error:

    Line 71:         Session["strSubscriberID"] = null;
    Line 72: 
    Line 73:         ((CustomNewslettersControlPanel)this.Parent).DisplayMode = CustomNewslettersControlPanel.Display.SubscriberOfGroup;
    Line 74: 
    Line 75:        

    Source File: c:\Projects\QFC_Live\Sitefinity\Admin\ControlTemplates\Notifications\SubscribersEditorTemplate.ascx.cs    Line: 73

Register for webinar
13 posts, 0 answered