Adding Custom Properties to subclass of FormsControl - General Discussions - General Discussions - Progress Community
 General Discussions

Adding Custom Properties to subclass of FormsControl

  • Adding Custom Properties to subclass of FormsControl
  • I would like to implement a "Thank You" email to users who fill out a form in Sitefinity. The email I will get from Sitefinity's built-in email editor.

     

    I think I need to:

     

    1) inherit from FormsControl

    2)Subscribe to IFormEvent 

    3) Get the formResponse:

    FormsManager formsManager = FormsManager.GetManager(); var formResponse =     formsManager.GetFormEntries(FormData).SingleOrDefault(fE => fE.ReferralCode == FormData.FormEntriesSeed.ToString());  var emailAddress=formResponse.GetValue("EmailAddress").ToString();

     

    4) Get the email template

    NewslettersManager newslettersManagermanager = NewslettersManager.GetManager();    MessageBody messageBody = newslettersManagermanager.GetMessageBodies().SingleOrDefault(b => b.Id == emailTemplateId);

     

    5) Send email 

     

     

    My question​s is, how do I define custom properties on my new inherited FormsControl?