Disable the default contact form email handler

Created on 13 December 2024, 8 days ago

Problem/Motivation

If you enable the forms recipe, the Webform module is installed and one Webform (contact form) is created. This contact form has by default an email handler set, so that all form submissions are sent to [site:mail]

The issue is, that we are not asking for the site email on install, instead we use a "random" email in the installer:

  // Automatically generate the site email address.
  $form['site_information']['site_mail'] = [
    '#type' => 'hidden',
    '#default_value' => 'no-reply@' . \Drupal::request()->getHost(),
  ];

It is very likely that this email will not work without changing it, so having a webform automatically send emails to this address is questionable. I suggest to disable the email handler (not remove it, only to disable it).

Steps to reproduce

Install Drupal CMS with the forms recipe
Go to contact form email handlers (/admin/structure/webform/manage/contact_form/handlers) and observe that there is an automatic email set by default to our auto-generate email address

Proposed resolution

Disable the email handler by default

Remaining tasks

User interface changes

API changes

Data model changes

πŸ“Œ Task
Status

Active

Component

Track: Contact form

Created by

πŸ‡ΈπŸ‡°Slovakia poker10

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024