Subscribe functionality in regular form

Posted by Community Admin on 04-Aug-2018 17:19

Subscribe functionality in regular form

All Replies

Posted by Community Admin on 02-Sep-2014 00:00

My business user wants to create a poll for our customers using the normal Forms module, but they also want to have a checkbox on the form that allows the customer to sign up for a particular mailing list they already have setup in Sitefinity.   How can I create a form that acts like a normal form, but also has the subscribe functionality and how do I link that to the correct mailing list?

Posted by Community Admin on 05-Sep-2014 00:00

Hi Aaron,

Sitefinity does not expose such functionality out of the box. You can attach to the IFormEntryCreated event in the Eventhub where you can check the value of the checkbox control

public void FormsEventHandler(IFormEntryCreatedEvent eventInfo)
        
            var entryId = eventInfo.EntryId;
            var formName = eventInfo.FormName;
 
            var manager = FormsManager.GetManager();
            FormEntry entry = null;
            var form = manager.GetFormByName(formName);
 
            if (form != null)
            
                string entryType = String.Format("0.1", manager.Provider.FormsNamespace, form.Name);
                entry = manager.GetFormEntry(entryType, entryId);
            
 
            if (entry != null)
            
                var fieldValue = entry.GetValue("FormControlProgrammaticName");
            
        

If the user has checked it, leverage the subscribers API to add it to the maililng list. 

Regards,
Pavel Benov
Telerik
 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

This thread is closed