1 user.module | _user_mail_text($key, $language = NULL, $variables = array()) |
Returns a mail string for a variable name.
Parameters
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.:
File
- core/
modules/ user/ user.module, line 2434 - Enables the user registration and login system.
Code
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.
$text = config('user.mail')->getTranslated($key, array(), array(
'langcode' => $langcode,
));
$options = array(
'langcode' => $langcode,
'callback' => 'user_mail_tokens',
'sanitize' => FALSE,
'clear' => TRUE,
);
return token_replace($text, $variables, $options);
}