Currently, the whole email generated by the Contact module is without a single line break. They look very ugly. Is there a way to edit the email template for specific contact forms?


1 Answer 1


If you check core.services.yml you can see the service which sends mail (plugin.manager.mail). It looks for overrides for default mail plugin starting from message_id to module name. You can create simple new mail plugin which sends HTML mail and set this in configuration "system.mail".

 drush cset system.mail interface.contact your_mail_plugin  // this will change mail plugin for contact module

Creating a mail plugin is easy and you can find example here Drupal\Core\Mail\Plugin\Mail

MailSystem module does this and it supports advanced options https://www.drupal.org/project/mailsystem

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.