MailCancelTestHooks.php

Namespace

Drupal\mail_cancel_test\Hook

File

core/modules/system/tests/modules/mail_cancel_test/src/Hook/MailCancelTestHooks.php

View source
<?php

declare (strict_types=1);
namespace Drupal\mail_cancel_test\Hook;

use Drupal\Core\Hook\Attribute\Hook;

/**
 * Hook implementations for mail_cancel_test.
 */
class MailCancelTestHooks {
    
    /**
     * Implements hook_mail_alter().
     *
     * Aborts sending of messages with ID 'mail_cancel_test_cancel_test'.
     *
     * @see MailTestCase::testCancelMessage()
     */
    public function mailAlter(&$message) {
        if ($message['id'] == 'mail_cancel_test_cancel_test') {
            $message['send'] = FALSE;
        }
    }

}

Classes

Title Deprecated Summary
MailCancelTestHooks Hook implementations for mail_cancel_test.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.