Contact module overview

Last updated on
18 December 2017

The Contact module allows site visitors to send emails to other authenticated users and to the site administrator.


Through personal contact forms, users can send one another an e-mail. And through site-wide contact forms, users can send e-mail to arbitrary email addresses, such as the site maintainers.

With either form, users can specify a subject, write their message, and also have a copy of their e-mail sent to their own address. Through contact forms, users allow themselves to be contacted yet keep their own e-mail addresses private until the message is replied to. As an administrator, you can enable or disable the contact module altogether.

As a user, you can also enable or disable your personal contact form if that option has been provided. When the form is enabled, a contact tab is displayed in your user profile, for everyone to see. (Privileged users such as site administrators can contact users who have turned their forms off, as they can access their user account email addresses.) When you visit your own profile, the contact tab is not displayed. However, it is displayed to other users (if it has been enabled).

You can set up "categories" for the site-wide contact form, to allow for multiple recipient options. For example, one category might be "website feedback," and another might be "product information." For each category, you can specify one or more email addresses to which the form will be sent. You can also specify whether or not the user will receive an automatic reply.

You can specify the text to display on your site-wide contact page and you can optionally limit how many times a user can submit a contact form in an hour.


Enabling Contact module

To enable the Contact module:

  1. Navigate to the Modules administration page Menu > Extend or
  2. In the Core module section, enable the Contact module.
  3. Click Save configuration.

Configuring the site-wide Contact form

  1. Navigate to the Contact Form administration page (Menu > Structure > Contact forms or
  2. Click "Add contact form" and enter the following information:
  • Label: Enter a title.
  • Recipients: Enter one or more email addresses. Separate each address with a comma.
  • Auto-Reply: Enter an optional response such as an acknowledgement of receipt. Leave this field empty if you do not want to send an automated response.
  • Weights: Set the order in which the contact forms will be displayed.
  • Selected: Specify whether you want this contact form selected by default.
  • Click "Save".

Configure the user Contact form

  1. Navigate to the Account Settings page (Administration > Configuration > People > Accounts or
  2. In the Contact settings section specify whether the contact form is enabled for users by default.
  3. Click "Save configuration."

Controlling repeat submission blocking (flood control)

There are hard-coded limits to how frequently contact forms can be submitted. In Drupal 8, a special drush command provides a way to configure flood control behavior:
drush cedit contact.settings
This lets you change the limit and time limit after which the flood restriction resets.

Menu link

If you want your contact form to appear in a menu, go to Structure → Menus → Footer. Click on the "Enabled" checkbox at the right of the Contact item, click on "Save" at the bottom. For other edit options click on "edit" at the right of the Contact item, and in "Parent link" you can choose a different menu if you prefer. Thanks to the "weight" you can choose where the item will appear in the menu. The heavier the item the lower it will appear (for a vertical menu) or more to the right for a horizontal menu. Don't forget to click on "Save". No matter which menu you choose, you can move the Contact item to the location you want by dragging and dropping its handle in the form of arrowed cross, on the left. This will change the item weight. Don't forget to click on "Save". If you want to translate the menu item for your contact form, do it with the interface translation feature of the contributed module "internationalization": see HowTo: Basic Internationalization setup.

Adding content to the form

If you want to add text (for instance your phone number) or photos etc. to your form page, you can do that by adding a block (or several blocks) which will appear only on the contact form.