Just a quick suggestion to add the $userid (user's ID #) to the list of replacement text tokens. Having that value tokenized comes in handy when sending links to various screens on the recipient's user profile.

function _role_change_notify_get_variables($user, $rolename) {
  global $base_url;
  $variables = array(
    '%username' => $user->name,
    '%site' => variable_get('site_name', 'drupal'),
    '%uri' => $base_url,
    '%uri_brief' => drupal_substr($base_url, strlen('http://')),
    '%mailto' => $user->mail,
    '%date' => format_date(time()),
    '%login_uri' => url('user', NULL, NULL, TRUE),
    '%edit_uri' => url('user/'. $user->uid .'/edit', NULL, NULL, TRUE),
    '%role' => $rolename,
    '%userid' => $user->uid,        // Added %userid here.
  );
  return $variables;

Thanks!

Comments

rfay’s picture

Title: Add %userid to the list of replacement text tokens. » Add %uid to the list of replacement text tokens.

Committed to 5.x-1.2 and 6.x-1.2.

rfay’s picture

Status: Active » Fixed
mgenovese’s picture

Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.