You are here

README.txt in Reroute Email 2.x

Same filename and directory in other branches
  1. 8 README.txt
  2. 5 README.txt
  3. 6 README.txt
  4. 7 README.txt
REROUTE EMAIL
-------------

CONTENTS OF THIS FILE
---------------------

 * Description
 * Installation and configuration
 * Tips and Tricks
 * Settings code snippet
 * Test Email Form
 * Bugs / features / patches
 * Authors and maintainers
 * Link references

--------------------------------------------------------------------------------
                                 DESCRIPTION
--------------------------------------------------------------------------------

This module intercepts all outgoing emails from a Drupal site and reroutes them
to a list of predefined configurable email addresses.

This is especially useful in cases where you would not want emails sent from a
Drupal site to reach target users. For example, if a live site was copied to a
test site for development and testing purposes, in general, you would like to
prevent any email sent from the test site to reach real users of the original
site. The module is also an appropriate tool for checking closer outgoing emails
for formatting, footers, headers, and more.

Additionally, it is a good example of what hook_mail_alter(), available in
Drupal 5.x and later, can do.

--------------------------------------------------------------------------------
                        INSTALLATION AND CONFIGURATION
--------------------------------------------------------------------------------

To install this module, do the following:

1 - Download the module and copy it into your contributed modules folder:
[for example, your_drupal_path/sites/all/modules/contrib] and enable it from the
modules administration/management page (no requirements).
More information at: Installing contributed modules (Drupal 8) [1].

2 - Configuration:
After successful installation, browse to the Reroute Email settings page either
by using the "Configure" link (next to module's name on the modules listing
page), or page's menu link under:
Home » Administration » Configuration » Development
Path: /admin/config/development/reroute_email

3 - Enter a list of email addresses to route all emails to. If the field is
empty and no value is provided for rerouted email addresses, all outgoing
emails would be aborted and recorded in the recent log entries, with a full
dump of the email variables, which could provide an additional debugging
method. The allowed list section allows setting up lists of email address and
domain name exceptions for which outgoing emails would not be rerouted.

--------------------------------------------------------------------------------
                               TIPS AND TRICKS
--------------------------------------------------------------------------------

1 - Reroute Email provides configuration variables that can be directly
overridden in the settings.php file of a site. This is particularly useful for
moving sites from live to test and vice versa.

2 - An example of setup would be to enable rerouting on a test environment,
while making sure it is disabled in production.

Add the following line in the settings.php file for the test environment:
  $config['reroute_email.settings']['enable'] = TRUE;
  $config['reroute_email.settings']['address'] = 'your.email@example.com';

And for the live site, set it as follows:
  $config['reroute_email.settings']['enable'] = FALSE;

3 - Your custom module can add a special header 'X-Rerouted-Force' with TRUE or
FALSE value to any own emails in hook_mail or any emails in hook_mail_alter()
implementations. This header will force enable or disable email rerouting by
ignoring default settings.

--------------------------------------------------------------------------------
                            SETTINGS CODE SNIPPET
--------------------------------------------------------------------------------

Configuration and all the settings variables can be overridden in the
settings.php file by copying and pasting the code snippet below and changing
the values:

/**
 * Reroute Email module:
 *
 * To override specific variables and ensure that email rerouting is enabled or
 * disabled, change the values below accordingly for your site.
 */

// Enable email rerouting.
$config['reroute_email.settings']['enable'] = TRUE;

// Space, comma, semicolon, or newline-delimited list of email addresses. Every
// destination email address which is not on "Allowed list email addresses" list
// will be rerouted to these addresses. If the field is empty and no value is
// provided, all outgoing emails would be aborted and the email would be
// recorded in the recent log entries (if enabled).
$config['reroute_email.settings']['address'] = 'your.email@example.com';

// Space, comma, semicolon, or newline-delimited list of email addresses to pass
// through. Every destination email address which is not on this list will be
// rerouted. If the field is empty and no value is provided, all outgoing emails
// would be rerouted. We can use wildcard email "*@example.com" to add to
// allowed list all emails by the domain.
$config['reroute_email.settings']['allowed'] = '*@example.com, foo@bar.com';

// Space, comma, semicolon, or newline-delimited list of message keys to be
// rerouted. Either module machine name or specific mail key can be used for
// that. Only matching messages will be rerouted. If left empty (as default),
// all emails will be selected for rerouting.
$config['reroute_email.settings']['mailkeys'] = 'somemodule, mymodule_mykey';

// Enable inserting a message into the email body when the mail is being
// rerouted.
$config['reroute_email.settings']['message'] = TRUE;

--------------------------------------------------------------------------------
                               TEST EMAIL FORM
--------------------------------------------------------------------------------

Reroute Email also provides a convenient form for testing email sending or
rerouting. After enabling the module, a test email form is accessible under:
Admin » Configuration » Development » Reroute Email » Test email form
Path: /admin/config/development/reroute_email/test

This form allows sending an email upon submission to the recipients entered in
the fields To, Cc and Bcc, which is very practical for testing if emails are
correctly rerouted to the configured addresses.

--------------------------------------------------------------------------------
                          BUGS / FEATURES / PATCHES
--------------------------------------------------------------------------------

Feel free to follow up in the issue queue [2] for any contributions, bug
reports, feature requests.
Tests, feedback or comments in general are highly appreciated.

--------------------------------------------------------------------------------
                           AUTHORS AND MAINTAINERS
--------------------------------------------------------------------------------

kbahey (https://www.drupal.org/user/4063)
rfay (http://drupal.org/user/30906)
DYdave (http://drupal.org/user/467284)
bohart (https://drupal.org/user/289861)

If you use this module, find it useful, and want to send the author a thank you
note, then use the Feedback/Contact page at the URL above.

--------------------------------------------------------------------------------
                               LINK REFERENCES
--------------------------------------------------------------------------------

1: http://drupal.org/documentation/install/modules-themes/modules-8
2: https://www.drupal.org/project/issues/reroute_email

File

README.txt
View source
  1. REROUTE EMAIL
  2. -------------
  3. CONTENTS OF THIS FILE
  4. ---------------------
  5. * Description
  6. * Installation and configuration
  7. * Tips and Tricks
  8. * Settings code snippet
  9. * Test Email Form
  10. * Bugs / features / patches
  11. * Authors and maintainers
  12. * Link references
  13. --------------------------------------------------------------------------------
  14. DESCRIPTION
  15. --------------------------------------------------------------------------------
  16. This module intercepts all outgoing emails from a Drupal site and reroutes them
  17. to a list of predefined configurable email addresses.
  18. This is especially useful in cases where you would not want emails sent from a
  19. Drupal site to reach target users. For example, if a live site was copied to a
  20. test site for development and testing purposes, in general, you would like to
  21. prevent any email sent from the test site to reach real users of the original
  22. site. The module is also an appropriate tool for checking closer outgoing emails
  23. for formatting, footers, headers, and more.
  24. Additionally, it is a good example of what hook_mail_alter(), available in
  25. Drupal 5.x and later, can do.
  26. --------------------------------------------------------------------------------
  27. INSTALLATION AND CONFIGURATION
  28. --------------------------------------------------------------------------------
  29. To install this module, do the following:
  30. 1 - Download the module and copy it into your contributed modules folder:
  31. [for example, your_drupal_path/sites/all/modules/contrib] and enable it from the
  32. modules administration/management page (no requirements).
  33. More information at: Installing contributed modules (Drupal 8) [1].
  34. 2 - Configuration:
  35. After successful installation, browse to the Reroute Email settings page either
  36. by using the "Configure" link (next to module's name on the modules listing
  37. page), or page's menu link under:
  38. Home » Administration » Configuration » Development
  39. Path: /admin/config/development/reroute_email
  40. 3 - Enter a list of email addresses to route all emails to. If the field is
  41. empty and no value is provided for rerouted email addresses, all outgoing
  42. emails would be aborted and recorded in the recent log entries, with a full
  43. dump of the email variables, which could provide an additional debugging
  44. method. The allowed list section allows setting up lists of email address and
  45. domain name exceptions for which outgoing emails would not be rerouted.
  46. --------------------------------------------------------------------------------
  47. TIPS AND TRICKS
  48. --------------------------------------------------------------------------------
  49. 1 - Reroute Email provides configuration variables that can be directly
  50. overridden in the settings.php file of a site. This is particularly useful for
  51. moving sites from live to test and vice versa.
  52. 2 - An example of setup would be to enable rerouting on a test environment,
  53. while making sure it is disabled in production.
  54. Add the following line in the settings.php file for the test environment:
  55. $config['reroute_email.settings']['enable'] = TRUE;
  56. $config['reroute_email.settings']['address'] = 'your.email@example.com';
  57. And for the live site, set it as follows:
  58. $config['reroute_email.settings']['enable'] = FALSE;
  59. 3 - Your custom module can add a special header 'X-Rerouted-Force' with TRUE or
  60. FALSE value to any own emails in hook_mail or any emails in hook_mail_alter()
  61. implementations. This header will force enable or disable email rerouting by
  62. ignoring default settings.
  63. --------------------------------------------------------------------------------
  64. SETTINGS CODE SNIPPET
  65. --------------------------------------------------------------------------------
  66. Configuration and all the settings variables can be overridden in the
  67. settings.php file by copying and pasting the code snippet below and changing
  68. the values:
  69. /**
  70. * Reroute Email module:
  71. *
  72. * To override specific variables and ensure that email rerouting is enabled or
  73. * disabled, change the values below accordingly for your site.
  74. */
  75. // Enable email rerouting.
  76. $config['reroute_email.settings']['enable'] = TRUE;
  77. // Space, comma, semicolon, or newline-delimited list of email addresses. Every
  78. // destination email address which is not on "Allowed list email addresses" list
  79. // will be rerouted to these addresses. If the field is empty and no value is
  80. // provided, all outgoing emails would be aborted and the email would be
  81. // recorded in the recent log entries (if enabled).
  82. $config['reroute_email.settings']['address'] = 'your.email@example.com';
  83. // Space, comma, semicolon, or newline-delimited list of email addresses to pass
  84. // through. Every destination email address which is not on this list will be
  85. // rerouted. If the field is empty and no value is provided, all outgoing emails
  86. // would be rerouted. We can use wildcard email "*@example.com" to add to
  87. // allowed list all emails by the domain.
  88. $config['reroute_email.settings']['allowed'] = '*@example.com, foo@bar.com';
  89. // Space, comma, semicolon, or newline-delimited list of message keys to be
  90. // rerouted. Either module machine name or specific mail key can be used for
  91. // that. Only matching messages will be rerouted. If left empty (as default),
  92. // all emails will be selected for rerouting.
  93. $config['reroute_email.settings']['mailkeys'] = 'somemodule, mymodule_mykey';
  94. // Enable inserting a message into the email body when the mail is being
  95. // rerouted.
  96. $config['reroute_email.settings']['message'] = TRUE;
  97. --------------------------------------------------------------------------------
  98. TEST EMAIL FORM
  99. --------------------------------------------------------------------------------
  100. Reroute Email also provides a convenient form for testing email sending or
  101. rerouting. After enabling the module, a test email form is accessible under:
  102. Admin » Configuration » Development » Reroute Email » Test email form
  103. Path: /admin/config/development/reroute_email/test
  104. This form allows sending an email upon submission to the recipients entered in
  105. the fields To, Cc and Bcc, which is very practical for testing if emails are
  106. correctly rerouted to the configured addresses.
  107. --------------------------------------------------------------------------------
  108. BUGS / FEATURES / PATCHES
  109. --------------------------------------------------------------------------------
  110. Feel free to follow up in the issue queue [2] for any contributions, bug
  111. reports, feature requests.
  112. Tests, feedback or comments in general are highly appreciated.
  113. --------------------------------------------------------------------------------
  114. AUTHORS AND MAINTAINERS
  115. --------------------------------------------------------------------------------
  116. kbahey (https://www.drupal.org/user/4063)
  117. rfay (http://drupal.org/user/30906)
  118. DYdave (http://drupal.org/user/467284)
  119. bohart (https://drupal.org/user/289861)
  120. If you use this module, find it useful, and want to send the author a thank you
  121. note, then use the Feedback/Contact page at the URL above.
  122. --------------------------------------------------------------------------------
  123. LINK REFERENCES
  124. --------------------------------------------------------------------------------
  125. 1: http://drupal.org/documentation/install/modules-themes/modules-8
  126. 2: https://www.drupal.org/project/issues/reroute_email