You are here

content_moderation_notifications_test.module in Content Moderation Notifications 8.3

Hook implementations for the content moderation notifications test module.

File

tests/modules/content_moderation_notifications_test/content_moderation_notifications_test.module
View source
<?php

/**
 * @file
 * Hook implementations for the content moderation notifications test module.
 */
use Drupal\Core\Entity\EntityInterface;

/**
 * Implements hook_content_moderation_notifications_mail_data_alter().
 */
function content_moderation_notifications_test_content_moderation_notification_mail_data_alter(EntityInterface $entity, array &$data) {
  if (\Drupal::state()
    ->get('content_moderation_notifications_test.alter', FALSE)) {

    // Change mails to verify this hook has been called.
    $data['to'] = [
      'altered@example.com',
      'foo' . $entity
        ->id() . '@example.com',
    ];
  }
}

Functions

Namesort descending Description
content_moderation_notifications_test_content_moderation_notification_mail_data_alter Implements hook_content_moderation_notifications_mail_data_alter().