function _user_registrationpassword_mail_text in User registration password 6
Same name and namespace in other branches
- 7 user_registrationpassword.module \_user_registrationpassword_mail_text()
Returns a mail string for a variable name.
Used by user_registrationpassword_mail() and the settings forms to retrieve strings.
Parameters
string $key:
string $language:
array $variables:
Return value
string
3 calls to _user_registrationpassword_mail_text()
- user_registrationpassword_form_user_admin_settings_alter in ./
user_registrationpassword.module - Implements hook_form_FORM_ID_alter() for the user administration form.
- user_registrationpassword_mail in ./
user_registrationpassword.module - Implements hook_mail().
- user_registrationpassword_mail_edit_text in ./
user_registrationpassword.module - Implements hook_mail_edit_text().
File
- ./
user_registrationpassword.module, line 193 - Enables password creation on registration form.
Code
function _user_registrationpassword_mail_text($key, $language = NULL, $variables = array()) {
$langcode = isset($language) ? $language->language : NULL;
if ($admin_setting = variable_get('user_registrationpassword_' . $key, FALSE)) {
// An admin setting overrides the default string.
return strtr($admin_setting, $variables);
}
else {
// No override, return default string.
switch ($key) {
case 'status_activated_subject':
return t('Account details for !username at !site', $variables, $langcode);
case 'status_activated_body':
return t("!username,\n\nYour account at !site has been activated.\n\nYou will be able to log in to !login_uri in the future using:\n\nusername: !username\npassword: your password.\n\n-- !site team\n", $variables, $langcode);
case 'register_subject':
return t('Account details for !username at !site', $variables, $langcode);
case 'register_body':
return t("!username,\n\nThank you for registering at !site. You may now log in and verify your account by clicking this link or copying and pasting it to your browser:\n\n!registrationpassword-url\n\nThis link can only be used once. You will be able to log in at !login_uri in the future using:\n\nusername: !username\npassword: Your password\n\n-- !site team", $variables, $langcode);
}
}
}