| 6 user.module | user_mail_tokens( |
| 7 user.module | user_mail_tokens(&$replacements, $data, $options) |
| 8 user.module | user_mail_tokens(&$replacements, $data, $options) |
Return an array of token to value mappings for user e-mail messages.
Parameters
$account: The user object of the account being notified. Must contain at least the fields 'uid', 'name', 'pass', 'login', and 'mail'.
$language: Language object to generate the tokens with.
Return value
Array of mappings from token names to values (for use with strtr()).
1 call to user_mail_tokens()
File
- modules/
user/ user.module, line 2133 - Enables the user registration and login system.
Code
function user_mail_tokens($account, $language) {
global $base_url;
$tokens = array(
'!username' => $account->name,
'!site' => variable_get('site_name', 'Drupal'),
'!login_url' => user_pass_reset_url($account),
'!uri' => $base_url,
'!uri_brief' => preg_replace('!^https?://!', '', $base_url),
'!mailto' => $account->mail,
'!date' => format_date(time(), 'medium', '', NULL, $language->language),
'!login_uri' => url('user', array('absolute' => TRUE, 'language' => $language)),
'!edit_uri' => url('user/' . $account->uid . '/edit', array('absolute' => TRUE, 'language' => $language)),
);
if (!empty($account->password)) {
$tokens['!password'] = $account->password;
}
return $tokens;
}
Login or register to post comments
Comments
!password not working
!password not working in email drupal 6, how can we resolve this issue
There is no issue here.
There is no issue here. The token DOES work, but only in very specific situations - for "Welcome, no approval required" and "Welcome, new user created by administrator" emails (see
user.module). It is not possible to get password value in other cases, as its value stored in the database is encrypted.token's not working for workflow
when I assign a action mail to workflow process the mail I received is not parsing the token !node_url. Some error in Workflow module must be there. I am searching for.