diff -u b/core/modules/user/lib/Drupal/user/UserConfigContext.php b/core/modules/user/lib/Drupal/user/UserConfigContext.php --- b/core/modules/user/lib/Drupal/user/UserConfigContext.php +++ b/core/modules/user/lib/Drupal/user/UserConfigContext.php @@ -13,6 +13,11 @@ /** * Defines a configuration context object for a user account. + * + * This should be used when configuration objects need a context for a user + * other than the current user. + * + * @see user_mail() */ class UserConfigContext extends ConfigContext { diff -u b/core/modules/user/user.module b/core/modules/user/user.module --- b/core/modules/user/user.module +++ b/core/modules/user/user.module @@ -1757,8 +1757,10 @@ $langcode = $message['langcode']; $variables = array('user' => $params['account']); - // Get configuration objects customized for this user, that may be localized - // for the user's language if the locale module is enabled. + // Get configuration objects customized for the user specified in $params as + // this user is not necessarily the same as the one triggering the mail. This + // allows the configuration objects to be localized for the user's language if + // the locale module is enabled. $user_config_context = config_context_enter("Drupal\\user\\UserConfigContext"); $user_config_context->setAccount($params['account']); $mail_config = config('user.mail');