user_mail_tokens

Versions
6
user_mail_tokens($account, $language)
7
user_mail_tokens(&$replacements, $data, $options)

Token callback to add unsafe tokens for user mails.

See also

user_mail()

Code

modules/user/user.module, line 2310

<?php
function user_mail_tokens(&$replacements, $data, $options) {
  if (isset($data['user'])) {
    $replacements['[user:one-time-login-url]'] = user_pass_reset_url($data['user']);
    $replacements['[user:cancel-url]'] = user_cancel_url($data['user']);

    if (isset($data['user']->password) && !empty($data['user']->password)) {
      $replacements['[user:password]'] = $data['user']->password;
    }
  }
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.