Customize landings using Web-to-Case
Web-to-Case functionality implements the ability to create cases in the Creatio by filling the required form fields embedded in a third-party site - landing.
The ProductCore
package depends on the WebForms
package, that contains Web-to-Case functionality. This means that landings can be used in all products. Pre-configured base functionality is implemented in the service enterprise, customer center, marketing products and all bundles that these products are part of.
More information about landings can be found in the Integrate with landing pages and web forms article of the corresponding products (such as Marketing Creatio).
Web-to-Case configuration can be done in the system interface. To implement generated JavaScript to a third-party site, you need the basic Web development skills.
The Web-to-Case base functionality allows to configure the following features without programming (using minor improvements on a third-party site):
- The form interface and styles.
- List of the additionally passed fields.
- List of default values for the fields that are not displayed in the form.
- The list of domains from which the case registration for each landing will be possible.
- The address to which the user will be redirected after submitting the form.
- JavaScript event handlers of successful/unsuccessful case registration.
- Additional landings, that can be configured in different way. That makes it possible to distinguish cases created from different sites.
You can modify the project to set up a preliminary handler of case registration through the Web-to-Case with the data validation, correction, creation of related entities and etc. The automatic creation of contact for the registered case is configured in the Creatio base configuration in the handler of case registration through the Web form.
The logic of the automatic filling of case fields.
In the process of case registration through the Web form, the following fields are recommended for filling: Name, Email, Phone, Case subject. The Case subject value will be passed to the new case.
The Creatio will identify the contact by Name, Email and Phone fields. The search is performed in a following way:
- If contact fields matches the [Name], [Email] and [Phone] fields from the filled form, they will be added to the created case.
- If contact fields matches only the [Name] and [Email] fields from the filled form, they will be added to the created case.
- If contact fields matches only the [Email] field from the filled form, it will be added to the created case.
- Otherwise, a new contact is created and the [Name], [Email] and [Phone] fields will be filled in. The created contact is added to the registered case.
If more than one contact are found, then the first contact will be used as contact of the case. Also the case registration date (RegisteredOn
column) will be automatically filled with the current date and time.
Recommendations for the execution of project solutions
If you need to customize the Web-to-Case, use its base functionality as an example.
To execute the project solution:
- Create a page schema that is inherited from the
CaseGeneratedWebFormPageV2
. The page should not be a replacement page. - Add a record of the new type of landing to the
LandingType
table and localization to theSysLandingTypeLcz
table. - Register the typed page created in the first step (the value of the type is new).
- If you need preliminary processing of the form data before saving the record in the database, you need to create a class that implements the
IGeneratedWebFormPreProcessHandler
interface. This class is a preliminary handler for case registration. Implement theExecute()
method. This method is the entry point to the handler. Additional actions are implemented in this method. You can take theWebFormCasePreProcessHandler
schema as an example. - If you need to perform actions after saving the record in the database, you need to create a class that implements the
IGeneratedWebFormPreProcessHandler
interface. This class is a preliminary handler for case registration. Implement theExecute()
method and perform necessary actions. - If you created the registration handlers of the case, register them in the
WebFormProcessHandlers
table. Use an existing record as an example of registration. - Edit the script template that forms the configuration JavaScript object of the landing, and place it in the
ScriptTemplate
localized string of the created page. Specify the similar script for all localizations used. You can find an example of the script in theCaseGeneratedWebFormPageV2
schema. - Bind all created data to the package.