1 user.module _user_mail_text($key, $language = NULL, $variables = array())

Returns a mail string for a variable name.


string $key: The config key that provides the mail text.

object $language: A language object.

array $variables: An array of token keys and values.

Return value

A string value containing the text for the user.mail config key.:


core/modules/user/user.module, line 2349
Enables the user registration and login system.


function _user_mail_text($key, $language = NULL, $variables = array()) {
  $langcode = isset($language) ? $language->langcode : NULL;

  // We do not sanitize the token replacement, since the output of this
  // replacement is intended for an email message, not a web browser.
  return token_replace(config('user.mail')->getTranslated($key, array(), array('langcode' => $langcode)), $variables, array('langcode' => $langcode, 'callback' => 'user_mail_tokens', 'sanitize' => FALSE, 'clear' => TRUE));