Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
rfayCommitted to 5.x-1.2 and 6.x-1.2.
Comment #2
rfayComment #3
mgenovese CreditAttribution: mgenovese commentedThanks!