Theme my login replacement variables filter. Used to add your own variables to the Custom Emails module of theme my login. Uses tml_replace_vars.
function custom_email_replace($old_replacements, $user_id){
// Generate the new url we need for this user
$enrollment_form_url = 'special-url-'.$user_id;
// An array of our replacement variables and their values
$new_replacements = array(
'%enrollmentform%'=> $enrollment_form_url,
);
// Merge our two arrays together
$replacements = array_merge($old_replacements, $new_replacements);
// Return the array of all the replacements
return $replacements;
}
add_filter( 'tml_replace_vars', 'custom_email_replace', 99, 2 );