You are here

function opigno_learning_path_mail in Opigno Learning path 8

Same name and namespace in other branches
  1. 3.x opigno_learning_path.module \opigno_learning_path_mail()

Implements hook_mail().

File

./opigno_learning_path.module, line 2285
Contains opigno_learning_path.module.

Code

function opigno_learning_path_mail($key, &$message, $params) {
  if (in_array($key, [
    'opigno_learning_path_user_subscribe',
    'opigno_learning_path_add_membership',
    'opigno_learning_path_membership_needs_validate',
    'opigno_learning_path_membership_validated',
    'training_expiring_certification',
    'opigno_learning_path_managers_notify',
    'opigno_learning_path_user_notify',
  ])) {
    $message['from'] = \Drupal::config('system.site')
      ->get('mail');
    $message['subject'] = $params['subject'];
    $message['body'][] = $params['message'];
  }
}