Adding Custom Properties to subclass of FormsControl

Posted by Community Admin on 03-Aug-2018 18:16

Adding Custom Properties to subclass of FormsControl

All Replies

Posted by Community Admin on 22-May-2015 00:00

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?

This thread is closed