--- token_profile.module	2010-10-29 10:58:49.000000000 +0800
+++ token_profile/token_profile.module	2010-07-29 22:46:32.000000000 +0800
@@ -117,63 +117,3 @@
       return check_plain($field->value);
   }
 }
-
-/**
- * Implementation of hook_mail_alter().
- *
- * @param Array $message A structured array containing the message to be altered. keys in this array include: id, to, subject, body, from, headers
- */
-function token_profile_mail_alter(&$message) {
-  //check to see that it is the user module that is sending the email
-  switch ($message['id']) {
-    case 'user_register_admin_created':
-    case 'user_register_no_approval_required':
-    case 'user_register_pending_approval':
-    case 'user_password_reset':
-    case 'user_status_activated':
-    case 'user_status_blocked':
-    case 'user_status_deleted':
-      //load the profile tokens array to replace in the message
-      $profile_tokens = _token_profile_get_token_values($message['to']);
-      
-      //check to see that something was loaded
-      if ($profile_tokens === FALSE) {
-        return;
-      }
-      
-      //modify the message and subject to replace the profile tokens
-      $message['subject'] = strtr($message['subject'], $profile_tokens);
-      foreach ($message['body'] as $i => $body) {
-        $message['body'][$i] = strtr($message['body'][$i], $profile_tokens);
-      }
-      
-      break;
-  }
-}
-
-/**
- * Builds a keyed array of profile tokens and values for a user that can be used in strtr
- * 
- * @param String $email The email address of the user to load
- * 
- * @return Array A keyed array with the keys the profile tokens and the values the users profile values
- */
-function _token_profile_get_token_values($email) {
-  //attempt to load the user fomr the email
-  $user = user_load(array('mail' => $email));
-  if ($user === FALSE) {
-    return FALSE;
-  }
-  
-  //load the users profile
-  profile_load_profile($user);
-  $fields = _token_profile_profile_fields();
-  
-  $values = array();
-  foreach ($fields as $name => $field) {
-    $field->value = $user->$name;
-    $values['!' . $name] = _token_profile_format_field($field);
-  }
-
-  return $values;
-}
\ No newline at end of file
