From 56e416cce63b30445426a0dba2c36991d559e8f0 Mon Sep 17 00:00:00 2001 From: Alex Pott Date: Sat, 14 May 2016 11:54:48 -0500 Subject: [PATCH] Issue #2722265 by willito, kellyimagined, joachim, hussainweb, munizjor, selfuntitled, lisa.ugray, soulsesa, The Sean, kjl16, kurthill4: docs for MailManager::mail() refer to obsolete function user_preferred_langcode() --- core/lib/Drupal/Core/Mail/MailManagerInterface.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/core/lib/Drupal/Core/Mail/MailManagerInterface.php b/core/lib/Drupal/Core/Mail/MailManagerInterface.php index 35f1fd585bb..cdf4c8ae514 100644 --- a/core/lib/Drupal/Core/Mail/MailManagerInterface.php +++ b/core/lib/Drupal/Core/Mail/MailManagerInterface.php @@ -23,10 +23,11 @@ interface MailManagerInterface extends PluginManagerInterface { * * Finding out what language to send the email with needs some consideration. * If you send email to a user, her preferred language should be fine, so use - * user_preferred_langcode(). If you send email based on form values filled on - * the page, there are two additional choices if you are not sending the email - * to a user on the site. You can either use the language used to generate the - * page or the site default language. See + * \Drupal\Core\Session\AccountInterface::getPreferredAdminLangcode(). If you + * send email based on form values filled on the page, there are two + * additional choices if you are not sending the email to a user on the site. + * You can either use the language used to generate the page or the site + * default language. See * Drupal\Core\Language\LanguageManagerInterface::getDefaultLanguage(). The * former is good if sending email to the person filling the form, the later * is good if you send email to an address previously set up (like contact @@ -46,7 +47,7 @@ interface MailManagerInterface extends PluginManagerInterface { * $params['account'] = $account; * // example_mail() will be called based on the first * // MailManagerInterface->mail() parameter. - * \Drupal::service('plugin.manager.mail')->mail('example', 'notice', $account->mail, user_preferred_langcode($account), $params); + * \Drupal::service('plugin.manager.mail')->mail('example', 'notice', $account->mail, $langcode, $params); * } * } *