queue_mail_test.module in Queue Mail 8
Module for testing the Queue Mail module.
File
tests/modules/queue_mail_test/queue_mail_test.moduleView source
<?php
/**
* @file
* Module for testing the Queue Mail module.
*/
use Drupal\queue_mail_test\Plugin\Mail\QueueMailTestMailCollector;
/**
* Implements hook_mail().
*/
function queue_mail_test_mail($key, &$message, $params) {
$message['body'][] = $params['content'];
if ($key === 'skipped') {
$message['send'] = FALSE;
}
}
/**
* Implements hook_queue_mail_send_alter().
*/
function queue_mail_test_queue_mail_send_alter(&$message) {
if ($message['key'] === 'cancel_message') {
$message['send'] = FALSE;
}
}
/**
* Implements hook_mail_backend_info_alter().
*/
function queue_mail_test_mail_backend_info_alter(&$info) {
$info['test_mail_collector']['class'] = QueueMailTestMailCollector::class;
}
Functions
Name | Description |
---|---|
queue_mail_test_mail | Implements hook_mail(). |
queue_mail_test_mail_backend_info_alter | Implements hook_mail_backend_info_alter(). |
queue_mail_test_queue_mail_send_alter | Implements hook_queue_mail_send_alter(). |