By gábor hojtsy on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.x
Introduced in version:
8.0
Issue links:
Description:
As part of streamlining the APIs and unifying argument use, hook_mail() and hook_mail_alter() now converted as well to use $langcode instead of full language objects.
Drupal 7:
drupal_mail('contact', 'page_mail', $to, language_default(), $values, $from);
function user_mail($key, &$message, $params) {
$language = $message['language'];
$variables = array('user' => $params['account']);
$message['subject'] .= _user_mail_text($key . '_subject', $language, $variables);
$message['body'][] = _user_mail_text($key . '_body', $language, $variables);
}
Drupal 8:
drupal_mail('contact', 'page_mail', $to, language_default()->langcode, $values, $from);
function user_mail($key, &$message, $params) {
$langcode = $message['langcode'];
$variables = array('user' => $params['account']);
$message['subject'] .= _user_mail_text($key . '.subject', $langcode, $variables);
$message['body'][] = _user_mail_text($key . '.body', $langcode, $variables);
}
(The other _user_mail_text() changes were due to configuration handling changes).
Related change to user_preferred_language(): http://drupal.org/node/1783392
Impacts:
Module developers