function system_mail

Same name in other branches
  1. 9 core/modules/system/system.module \system_mail()
  2. 8.9.x core/modules/system/system.module \system_mail()
  3. 10 core/modules/system/system.module \system_mail()
  4. 11.x core/modules/system/system.module \system_mail()

Implements hook_mail().

File

modules/system/system.module, line 3310

Code

function system_mail($key, &$message, $params) {
    $context = $params['context'];
    $subject = token_replace($context['subject'], $context);
    $body = token_replace($context['message'], $context);
    $message['subject'] .= str_replace(array(
        "\r",
        "\n",
    ), '', $subject);
    $message['body'][] = $body;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.