mail_cancel_test.module in Drupal 9
Same filename and directory in other branches
Helper module for the catching mail that needs to be cancelled.
File
core/modules/system/tests/modules/mail_cancel_test/mail_cancel_test.moduleView source
<?php
/**
* @file
* Helper module for the catching mail that needs to be cancelled.
*/
/**
* Implements hook_mail_alter().
*
* Aborts sending of messages with ID 'mail_cancel_test_cancel_test'.
*
* @see MailTestCase::testCancelMessage()
*/
function mail_cancel_test_mail_alter(&$message) {
if ($message['id'] == 'mail_cancel_test_cancel_test') {
$message['send'] = FALSE;
}
}
Functions
Name | Description |
---|---|
mail_cancel_test_mail_alter | Implements hook_mail_alter(). |