Portal Engine Questions on portal engine and web parts.
Version 4.x > Portal Engine > Add newsletter subscriber with an BizForm View modes: 
User avatar
Member
Member
support-schepnet - 3/16/2009 5:02:56 AM
   
Add newsletter subscriber with an BizForm
Is it possible to add a subscriber to a newsletter when they check a checkbox in a Bizform?

User avatar
Kentico Developer
Kentico Developer
kentico_martind - 3/17/2009 9:30:59 AM
   
RE:Add newsletter subscriber with an BizForm
Hello,

You can use sample code bellow to subscribe user in OnAfterSave event handler of BizForm (http://devnet.kentico.com/docs/devguide/adding_custom_actions_to_a_biz.htm):

SubscriberProvider.Subscribe(subscriberId, newsletterId, DateTime.Now, true);

The last parameter says if you want to send subscription confirmation e-mail to subscriber.

Best Regards,

Martin Dobsicek

User avatar
Member
Member
support-schepnet - 3/17/2009 9:46:15 AM
   
RE:Add newsletter subscriber with an BizForm
Thanks, I'll try that

User avatar
Member
Member
david.mason-aflglobal - 9/17/2013 2:48:41 PM
   
RE:Add newsletter subscriber with an BizForm
How can we accomplish this in version 7? Thanks, David.

User avatar
Member
Member
kentico_sandroj - 9/17/2013 5:41:38 PM
   
RE:Add newsletter subscriber with an BizForm
Hello,

In version 7 you can also use Global Events and:

CMS.Newsletter ► SubscriberInfoProvider ► Subscribe(Guid, Int32, Int32)

subscriberGuid (Guid)
Subscriber GUID

newsletterId (Int32)
Newsletter ID

siteId (Int32)
Site ID

Please let me know if you have any questions.

Best Regards,
Sandro