| Drupal
Contact Forms Are In the Drupal 8 Core

In Drupal 7, if you wanted to create contact forms, you had to use a contributed module. Webform and Entityform were the most popular options.

Now in Drupal 8, forms are in core. Will be saying to goodbye to those popular Drupal 7 modules? Read on and find out ...

Video on Contact forms in Drupal 8

The Contact module in Drupal 8

By default, Drupal 8 has the Contact module enabled, which wasn't true in Drupal 7.

The Contact module has also been greatly enhanced. No longer does it simply provide a contact form on user profiles.

Drupal 8 provides two default contact forms: "Personal contact form" and "Website feedback."

2 default Drupal contact forms

"Personal contact form" is the form that's added to each user's profile:

A Drupal 8 contact form

"Website feedback" is a generic website contact form. Drupal automatically provides a link to this form from the footer:

The Drupal 8 Website feedback form

Contact form settings

Each contact form has 2 main settings:

  • Recipients
  • Auto-reply

So you won't see any of the more advanced Webform features such as redirecting users to particular URL after submission.

Drupal 8 contact form settings

Contact form fields and settings

In Drupal 8 you can add fields to forms, so you can create complex forms with no contributed modules.

Forms also have custom elements: such as "Sender email,""Recipient username," and "Send copy to sender." These can be arranged in the "Manage Display" tab of each form.

Drupal 8 Contact form fields

Storing contact form messages

So can we say goodbye to Webform and Entityform and rely entirely on the Drupal 8 core? No. Not yet.

The one key feature that's missing with the Contact module is the ability to store messages sent through the forms.

This is odd, because Drupal 8 deals with contact messages as entities. You can add comments to them, for example. You just can't see them!

To solve this problem. you'll need a contributed module called Contact Storage. The author says they hope to have this in core for Drupal 8.1 and that would make a lot of sense, filling this functionality gap.

Drupal 8 contact storage module

After installing and enabling Contact Storage, you'll see an addition tab with a list of messages:

Contact Storage module on a Drupal 8 site

About the author

Steve is the founder of OSTraining. Originally from the UK, he now lives in Sarasota in the USA. Steve's work straddles the line between teaching and web development.