The content you're reading is getting on in years
This post is on the older side and its content may be out of date.
Be sure to visit our blogs homepage for our latest news, updates and information.
The following blog post will examine how to implement notifications for Forms responses. We are going to implement this feature to be available out of the box, and you can use this quick and easy approach to have the notifications until we release them as part of the system. The built in Forms provides a number of events on which you can hook to in order to get custom validation, or custom actions when the form is submitted. We are going to use this extensibility point to implement our functionality.
First we need to inherit from the built-in FormsControl class and we need to wire the BeforeFormAction event handler. In this handler we are going to get the title of the form being submitted, the response, and construct the e-mail message. To be able to send the message we need to have valid SMTP settings in your System Configuration. Here is the code for the custom control:
For further information on how you can work with entries, please check out the Forms Module developer topics: Working with forms.
After the control is implemented we have to substitute the built in one with the custom one. To do this, go to Administration -> Settings -> Advanced -> Toolboxes -> PageControls -> Sections -> ContentToolboxSection -> Tools -> FormsControl. There edit the Control CLR Type or Virtual Path property. Substitute the original value with the CLR Type of the custom control. Now whenever a user adds the Forms control to pages the custom one will be used instead of the built-in one.
You can download the project for the custom control from this location: Forms notifications sample project. Make sure that you resolve the references to Sitefinity and OpenAccess assemblies.
View all posts from The Progress Team on the Progress blog. Connect with us about all things application development and deployment, data integration and digital business.
Subscribe to get all the news, info and tutorials you need to build better business apps and sites
You have the right to request deletion of your Personal Information at any time.
You can also ask us not to pass your Personal Information to third parties here: Do Not Sell My Info
We see that you have already chosen to receive marketing materials from us. If you wish to change this at any time you may do so by clicking here.
Thank you for your continued interest in Progress. Based on either your previous activity on our websites or our ongoing relationship, we will keep you updated on our products, solutions, services, company news and events. If you decide that you want to be removed from our mailing lists at any time, you can change your contact preferences by clicking here.
Let our experts teach you how to use Sitefinity's best-in-class features to deliver compelling digital experiences.Learn More