Subscribe functionality in regular form
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?
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"
);