More in this section
Forums / General Discussions / Adding Custom Properties to subclass of FormsControl

Adding Custom Properties to subclass of FormsControl

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
1 posts, 0 answered
  1. Elan
    Elan avatar
    5 posts
    Registered:
    16 Oct 2014
    22 May 2015
    Link to this post

    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?

1 posts, 0 answered