The documentation appears to leave out 2 keys in the $message array: 'params' and 'language'.

The following is an excerpt from the drupal_mail function, showing that these two variables are included in the array passed to hook_mail_alter.

// Bundle up the variables into a structured array for altering.
  $message = array(
    'id'       => $module .'_'. $key,
    'to'       => $to,
    'from'     => isset($from) ? $from : $default_from,
    'language' => $language,
    'params'   => $params,
    'subject'  => '',
    'body'     => array()
  );

Comments

jhodgdon’s picture

Issue tags: +Novice

The Drupal 7 doc for hook_mail_alter has these two components: http://api.drupal.org/api/function/hook_mail_alter/7

Drupal 6 version leaves them out, and sja1 is correct that they are in http://api.drupal.org/api/function/drupal_mail/6 and should be documented in hook_mail_alter().

jhodgdon’s picture

Title: Documentation problem with hook_mail_alter » hook_mail_alter() missing components in doc
jhodgdon’s picture

Status: Active » Fixed

I fixed this for Drupal 6 (it's in the contrib repository). Just copied the relevant lines from Drupal 7 doc.
http://drupal.org/cvs?commit=272426

Status: Fixed » Closed (fixed)
Issue tags: -Novice

Automatically closed -- issue fixed for 2 weeks with no activity.