DEPRECATION WARNING

This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.

‘formhandler’ Hook Handler

The extension also includes an example for a hook handler class for the ‘formhandler’ extension. This can be useful if one for example wants to have contact form with a checkbox, where the user can decide if he wants to receive further information via newsletter. So there are two parts: first the contact form, which sends an e-mail to the webmaster, and second the ‘formhandler’ hook handler, which subscribes the users e-mail address in the newsletter list.

Reference

The hook handler has to be activated with the TypoScript setting in formhandler configuration.

# Configuration EXTENSION formhandler
plugin.Tx_Formhandler.settings {
  # Finishers configuration
  finishers {
    1.class = Eyepin\Eyepin6\Finisher\Eyepin
  }
}

Without this settings the handler would do nothing. Please remember that Eyepin finisher has to be called before Redirect finisher (if used).

The above example sends the ‘AddressInsert’ command to www.eyepin.com if the form field ‘formhandler[newsletter]’ is true. In this case this could be a checkbox labeled “Subscribe to newsletter”. If the user sends the form without checking the checkbox, nothing special happens. The ‘formhandler’ extension works as configured. If the user sends the form with the checkbox checked, additionally to the ‘formhandler’ behaviour the filled in firstname, lastname, and e-mail address is sent to the eyepin® server to subscribe the user to the newsletter list of user ‘john’