Zum Inhalt springen

E-mail forms

Extension Key: form

Introduction

TYPO3 already has its own extension for creating e-mail forms: form Although it cannot keep up with other extensions such as Powermail or Formhandler in terms of functions, it is quite suitable for creating relatively simple forms.

It offers the following features, among others:

  • Compilation of forms via drag'n drop
  • Validation of input, e.g. for e-mail addresses, URL, numbers, letters, regular expressions and more
  • Extensive customization options via Typoscript (more for experienced TYPO3 users)

However, there is also a disadvantage: although the integration of captcha extensions is described in the documentation, this is unfortunately not possible in the current version (as of January 2013).

All the following screenshots are from TYPO3 6.0.0.

Installation

Although form is already included with TYPO3, you should check in the Extension Manager whether the extension is also installed.

You must then integrate the static template of the extension into your root template.

This video shows how to set up form and create a form.

Create form

You can then start to create a form. To do this, create a new content element on the desired page and select the "Mail form" in the "Forms" area.

You can create the form in the "Form" tab in the content element settings. form offers a wizard with which the form can be put together using drag and drop. To make the button for the so-called form wizard visible, you must save the content element once.

Form Wizard

In the Form Wizard, you can drag the required form elements from the left-hand area to the right-hand area using the mouse. Once an element has been placed there, you can make settings in the "Options" area. For example, the label of the field or whether one or more validity checks should be carried out.

Both standard form elements and predefined element groups are available to you. Content elements such as headings or text blocks can also be inserted into the form.

The order of the elements can be changed at any time using drag'n drop.

Customize and optimize forms

After you have saved and closed the Form Wizard, you will see the configuration settings of the form in the text field in the "Form" area. This is Typoscript.

Changes to the form can either be made via the Form Wizard or directly in this text field.

The postProcessor area is particularly interesting.

Here you can make a few improvements such as customizing the notification text after submitting the form or inserting the e-mail address of the website visitor as the sender address of the e-mail sent.

An error also occurs in connection with TYPO3 6.0.0: no confirmation text is output after the form has been sent. However, this error can be solved by defining this text in the postProcessor area via the parameter messages.success.

In the default setting, form behaves in such a way that an "intermediate page" appears after the form has been submitted, on which the user can check their entries again. Here they have the option of either going back to the form or finally sending the message. If you want to save yourself this intermediate step, you can also set the parameter confirmation = 0 here.

An example configuration

# deactivate the confirmation page, form is then sent directly
confirmation = 0

postProcessor {
 1 = mail
 1 {
   recipientEmail = empfaenger.der@email.net
 
   # The sender email address is dynamically read from the form field with the name email
   senderEmailField = email

   # the sender name is dynamically read from the form field surname
   senderNameField = surname

   subject = request via form

   # Message that is displayed after submitting the form
   # HTML can also be used here
   messages.success = TEXT
   messages.success.value (
     <h2>Thank you for your message</h2>
     <p>We will get in touch with you as soon as possible</p>
   )
 }
}

Further parameters can be found in the extension documentation from page 105 in the postprocessors section.

Customize mail dispatch

TYPO3 6.0.0 currently still has the problem that no confirmation is displayed after submitting a form. However, this can be fixed quite easily. You can also optimize and adapt the mail dispatch a little.

This page contains automatically translated content.

Updated: 17.07.2024