Drupal is a registered trademark of Dries Buytaert

mail_action

16 sites Security covered
View on drupal.org

This module adds configurable actions for sending mails. Drupal core only provides a mail action that supports plain text. This module adds further mail actions that allow to send formatted text and raw HTML.

Features

Adds the ability to send mails with HTML formatting anywhere actions are supported, for example in Views Bulk Operations and ECA.

Post-Installation

Once installed, you have two more action plugins available. They can be used anywhere actions are involved.

The new action plugins are called

  • "Send email with formatted text" - there you can choose your preferred configured WYSIWYG editor and format your mail using that way.
  • "Send email with raw HTML" - provides a textarea where you can insert raw HTML. It additionally supports Tokens and Twig template language.

Additional Requirements

This module only requires Drupal core. No other contrib module is required.

This module is especially useful in combination with another module that makes use of actions. For example

Similar projects

This module is very simplistic by just adding new action plugins. If you need more extensive mail functionality, have a look at following solutions:

Installation

Install the module as you would normally install a contributed
Drupal module. Visit https://www.drupal.org/node/1897420 for further
information.

You probably need to initially configure the mailer DSN settings of your
site. More details about configuring the transport DSN can be found here:
https://www.drupal.org/node/3369935

Following example can be used in a local `settings.php` file to test mailing
locally with MailHog (https://github.com/mailhog/MailHog):

<?php
// Mailer DSN settings for local testing with MailHog.
$config['system.mail']['mailer_dsn'] = [
  'scheme' => 'smtp',
  'host' => 'localhost',
  'port' => 1025,
];

// Following part is usually not needed. This will be automatically configured
// when installing the module.
$config['system.mail']['interface']['mail_action'] = 'mail_action_html';
?>

Activity

Total releases
2
First release
Oct 2025
Latest release
3 months ago
Release cadence
46 days
Stability
50% stable

Releases

Version Type Release date
1.0.0 Stable Nov 18, 2025
1.0.0-beta1 Pre-release Oct 3, 2025