+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Adding Custom Properties to subclass of FormsControl

Adding Custom Properties to subclass of FormsControl

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