You are here

function activity_send_email_mail in Open Social 8

Same name and namespace in other branches
  1. 8.9 modules/custom/activity_send/modules/activity_send_email/activity_send_email.module \activity_send_email_mail()
  2. 8.2 modules/custom/activity_send/modules/activity_send_email/activity_send_email.module \activity_send_email_mail()
  3. 8.3 modules/custom/activity_send/modules/activity_send_email/activity_send_email.module \activity_send_email_mail()
  4. 8.4 modules/custom/activity_send/modules/activity_send_email/activity_send_email.module \activity_send_email_mail()
  5. 8.5 modules/custom/activity_send/modules/activity_send_email/activity_send_email.module \activity_send_email_mail()
  6. 8.6 modules/custom/activity_send/modules/activity_send_email/activity_send_email.module \activity_send_email_mail()
  7. 8.7 modules/custom/activity_send/modules/activity_send_email/activity_send_email.module \activity_send_email_mail()
  8. 8.8 modules/custom/activity_send/modules/activity_send_email/activity_send_email.module \activity_send_email_mail()
  9. 10.3.x modules/custom/activity_send/modules/activity_send_email/activity_send_email.module \activity_send_email_mail()
  10. 10.0.x modules/custom/activity_send/modules/activity_send_email/activity_send_email.module \activity_send_email_mail()
  11. 10.1.x modules/custom/activity_send/modules/activity_send_email/activity_send_email.module \activity_send_email_mail()
  12. 10.2.x modules/custom/activity_send/modules/activity_send_email/activity_send_email.module \activity_send_email_mail()

Implements hook_mail().

File

modules/custom/activity_send/modules/activity_send_email/activity_send_email.module, line 256
Contains activity_basics.module..

Code

function activity_send_email_mail($key, &$message, $params) {
  $options = [
    'langcode' => $message['langcode'],
  ];
  $variables = [
    '%site_name' => \Drupal::config('system.site')
      ->get('name'),
  ];
  switch ($key) {
    case 'activity_send_email':

      // Mail subject.
      $message['subject'] = t('Notification from %site_name', $variables, $options);

      // Mail body.
      $message['body'][] = $params['body'];
      break;
  }
}