Skip to content

floyson-reference/Sitecore-Forms-Extensions

 
 

Repository files navigation

Sitecore-Forms-Extensions

Check my blogposts on http://onelittlespark.bartverdonck.be/category/sitecore-forms-extensions/ for detailed information on usage.

Download

Downloads can be found here

Why

The new Sitecore Forms module that came with Sitecore 9 is a very promissing tool that allows content editors to add custom forms to their website.

This module aims to add some functionality to this forms creator.

What

1.4

  • Binding Fields aka Prefill, Added functionality to the forms module to prefill the fields with data from another source. Build-in the library supports prefilling from the xDB profile of the current user filling in the form. But it can be easily extended to add your own binding to external databases, crm's, userprofile, etc... Not only can you prefill the fields, but the module also allows to store the values back into the binded field. (e.g. You can prefill a first name field with the first name from the xDb profile. You can choose to save the value filled in onto the xDB profile after submittion.) More info can be found here Find out how you can add your own databinder
  • Identify Contact, Custom Submit Action. Allows to choose a field from the form, who's entered value will be used as the identifiervalue of the xdb profile. (In other words, it will make the visitor a known contact.)

1.4.3

  • Bugfix for sql session state provider in combo with multipage form
  • Only save file once in multipage forms

1.4.2

  • Bugfix for multipage forms

1.4.1

  • Added FieldBindingMapApiController to allowedControllers in sitecore config.

1.3

  • The libraries integration with xDB had a refactoring. The update contact custom save action was removed. The forms extensions only focusses on the email address.
  • Introduction of the IXDbContactFactory. You can provide your own implementation here to use your own IdentifierSource and IdentifierValue to fetch contacts from xDB. The module comes with a default implementation that uses "email" as identifiersource and uses the email as its identiefiervalue.
<register serviceType="Feature.FormsExtensions.XDb.IXDbContactFactory, Feature.FormsExtensions" implementationType="Feature.FormsExtensions.XDb.FormsExtensionsXDbContactFactory, Feature.FormsExtensions" lifetime="Singleton" /> 

1.2

  • Send Email, Custom Submit Action: Replacement for Send Email to Fixed Address. This new action support sending mails to a fixed backoffice email address, the email of the current identified contact or to a value of the form. The values from the form are passed to EXM as custom tokens and can be used in the email.

1.1

  • Google ReCaptcha v2, Custom Form Element: Add this field on your form to secure your form by adding a Google Recaptcha v2 control into your form.
  • File Upload, Custom Form Element: Adds a file upload control to your toolbox. You can add a custom class to store the file anywhere you want. Out of the box this controls comes with a storage provider for local disk and for Azure Blog Storage Accounts.

1.0

  • Send Email to Fixed Address, Custom Submit Action: With this submit action you can send a mail to an email address defined on the submit action. (So not to the contact filling in the form as the build-in mailing action does) The values from the form are passed to EXM as custom tokens and can be used in the email.
  • Update Contact, Custom Submit Action: This is an implementation of the custom submit action walkthrough in the Sitecore documentation. It allows you to update the contacts firstname, lastname and email based on the content of the form.

Compatibility

The module is tested and compatible with Sitecore 9.0 - Update 1. Older versions are not supported.

Installation

Download the module under "downloads" and install as sitecore package. 2 config files should be patched:

  • Feature.FormsExtensions.Settings.config
    • GoogleCaptchaPublicKey
    • GoogleCaptchaPrivateKey
  • Feature.FormsExtensions.FileUploadStorageProviders.config Enable one of the FileUploadStorageProviders and fill in the attributes.
    • FileSystemFileUploadStorageProvider: Requires a path to store the files and an URL format to download the uploaded file afterwards.
    • AzureBlobStorageFileUploadStorageProvider: Requires BlobStorage ConnectionString and name of the blobcontainer. The connection string can be found in Azure on the Storage Account resource under "Access Keys"

Usage

For detailed info, check my blogposts on http://onelittlespark.bartverdonck.be/category/sitecore-forms-extensions/

Send Email To Fixed Address

  • Create an automated message in EXM, you can use the token $formFields$ to render the entire form results or use $form_fieldName$ to add the fields individually
  • Create a sitecore form, add the send email to fixed address action to your submit button. Enter a fixed email adress to send the form to, and choose your email campaign to be send out.

Google Captcha Control

Form Editors can just put this control on to their form. No additional configuration required.

File Upload Control

Form Editors can just put this control on to their form. No additional configuration required. Files are stored according to the installed fileuploadstorageprovider. (see installation)

Content Type Validator

This validator is linked to the file upload control and allows to enter a list of allowed content types. Files with other content types will be refused.

File Size Validtor

This validator is linked to the file upload control and checks the file size. If the file is larger then the entered value, it will be refused.