Portal Engine
Version 3.x > Portal Engine > Having new members automatically subscribed to newsletters View modes: 
User avatar
Member
Member
rockforddotnet - 10/17/2008 11:57:44 AM
   
Having new members automatically subscribed to newsletters
I just got done getting our .NET User Group site up and running. I noticed that when members first join, they are not automatically subscribed to recieve our newsletter. I would like for it to be a checkbox on the join form to indicate they want our newsletter. However, I will settle for just figuring out how to have it automatically happen. Having the users enter the same information into 2 different locations will not work. Please let me know if you have figured out what needs to happen for this to work. I'll post the solution if I figure it out before then. Thank you.

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 10/17/2008 1:38:20 PM
   
RE:Having new members automatically subscribed to newsletters
Hello,

Thank you for your message.

You could modify the code of RegistrationFrom web part (/CMSWebParts/Membership/RegistrationForm.ascx). Please see here how to modify the code of standard web parts: http://devnet.kentico.com/docs/devguide/modifying_the_design_of_standa.htm

You could add one checkbox with a label, for example.

In the code behind you would find the btnOK_Click method and after setting a user (about line 498), you could add your functionality. It would check the checkbox and if it would be checked it would add a new subscriber.

You could use our API – the API Reference could be found here: http://devnet.kentico.com/downloads/kenticocms_api.zip

You could create a new subcriber with the same info as user (name, e-mail...). Then you would use his new SubscriberId in CMS.Newsletter.SubscriberProvider.AddSubscription method. Please see to our API Reference. The NewsletterId could be found directly in your database (table Newsletter_Newsletter) or you could use again API to find out it.


Best Regards,

Helena Grulichova
Support Engineer

User avatar
Member
Member
rockforddotnet - 10/17/2008 1:57:31 PM
   
RE:Having new members automatically subscribed to newsletters
Thank you for the response. Getting into the code and making this new feature will be fun. I was wondering if it was built in, but going at it with code is what I like about this product. I'll try to get that done and post the final solution so others can benefit from this feature. Thanks again.