function role_watchdog_mail in Role Watchdog 8
Same name and namespace in other branches
- 6.2 role_watchdog.module \role_watchdog_mail()
- 6 role_watchdog.module \role_watchdog_mail()
- 7.2 role_watchdog.module \role_watchdog_mail()
- 7 role_watchdog.module \role_watchdog_mail()
Implements hook_mail().
File
- ./
role_watchdog.module, line 101 - Contains role_watchdog.module.
Code
function role_watchdog_mail($key, &$message, $params) {
$options = [
'langcode' => $message['langcode'],
];
switch ($key) {
case 'notification':
$message['from'] = \Drupal::config('system.site')
->get('mail');
$message['subject'] = t('Role watchdog notification on @site.', [
'@site' => \Drupal::config('system.site')
->get('name'),
], $options);
$message['body'][] = $params['message'];
break;
}
}