Reroute Email

"This module intercepts all outgoing emails from a Drupal site and reroutes them to a predefined configurable email address.

This is useful in case where you do not want email sent from a Drupal site to reach the users. For example, if you copy a live site to a test site for the purpose of development, and you do not want any email sent to real users of the original site. Or you want to check the emails sent fo

"This module intercepts all outgoing emails from a Drupal site and reroutes them to a predefined configurable email address.

This is useful in case where you do not want email sent from a Drupal site to reach the users. For example, if you copy a live site to a test site for the purpose of development, and you do not want any email sent to real users of the original site. Or you want to check the emails sent for uniform formatting, footers, ...etc.

This is also a good demonstration of what hook_mail_alter(), available in Drupal 5.x and later, can do."

Here's an example of using the module to only allow regular email to be sent on a Pantheon environment:

settings.php

<?php
  // Reroute Email module settings.
  // @see http://cgit.drupalcode.org/reroute_email/tree/README.txt
  // If this is the live Pantheon environment:
  if (defined('PANTHEON_ENVIRONMENT') && PANTHEON_ENVIRONMENT == 'live') {
    // Disables reroute_email module.
    $conf['reroute_email_enable'] = 0;
  }
  // Else, this is not the live Pantheon environment:
  else {
    // Enables the reroute_email module.
    $conf['reroute_email_enable'] = 1;
    // Sets the email address which will receive all outbound mail:
    $conf['reroute_email_address'] = 'noone@example.com';
    // Disables inserting a message into the email body when the mail is being
    // rerouted.
    $conf['reroute_email_enable_message'] = 0;
  }
 
?>

Internal References

External References

Article Type

Drupal Module: Development