Contact module overview

Last updated on
28 November 2016

Drupal 7 will no longer be supported after January 5, 2025. Learn more and find resources for Drupal 7 sites

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

Uses

Through personal contact forms users can send one another 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.

Configuration

Enabling Contact module

To enable the Contact module:

  1. Navigate to the Modules administration page Administration > Modules or http://example.com/admin/modules
  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 Administration > Structure > Contact orhttp://example.com/admin/structure/contact.
  2. Click "Add a Category" and enter the following information:
  • Category: 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 categories will be displayed.
  • Selected: Specify whether you want this category selected by default.
  • Click "Save".

Configure the user Contact form

  1. Navigate to the Account Settings page Administration > Configuration > People > Accounts or http://example.com/admin/config/people/accounts .
  2. In the Contact settings section specify whether the contact form is enabled for users by default.
  3. Click "Save configuration."

Permissions

  1. Navigate to the Permissions page (Administration > People > Permissions or http://example.com/admin/people/permissions).
  2. In the Contact section, specify whether a user role has the following permissions:
    • Administer contact forms and contact settings: Only administrators should be granted this permission.
    • Use the site wide contact form: Users with this permission can send messages to specific addresses that you specify.
    • Use users' personal contact forms: Users with this permission can send messages to any authenticated user who has enabled the contact form in their user settings. Granting this permission to unauthenticated users may not be desirable.
  3. Click "Save Permissions."

Menu link

If you want your contact form to appear in a menu, go to Structure → Menus → Navigation → List links. Click on the "enable" checkbox at the right of the contact item, click on "Save" at the bottom. Then click on "edit" at the right of the contact item, and in "Parent link" choose Main menu. Thanks to the "weight" you can choose at what place the item will appear in the menu. The heavier is the item the lower (for a vertical menu) or the righter (for an horizontal menu and a left-to-right theme) it will appear. Don't forget to click on "Save". In the Main menu list ( Structure → Menus → Main menu → List links) you move the Contact item to the location you want by can dragging and dropping its handle in 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. See Working with blocks (content in regions).

Tags

Help improve this page

Page status: No known problems

You can: