Index: pm_email_notify/pm_email_notify.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/privatemsg/pm_email_notify/Attic/pm_email_notify.module,v
retrieving revision 1.1.2.4
diff -u -p -r1.1.2.4 pm_email_notify.module
--- pm_email_notify/pm_email_notify.module	14 Sep 2009 15:55:22 -0000	1.1.2.4
+++ pm_email_notify/pm_email_notify.module	16 Sep 2009 15:36:28 -0000
@@ -106,7 +106,7 @@ function pm_email_notify_privatemsg_mess
 function pm_email_notify_mail($key, &$message, $params) {
   $language = $message['language'];
   $variables = user_mail_tokens($params['recipient'], $language);
-  $variables = array_merge($variables, _pm_email_notify_token($params['message']));
+  $variables = array_merge($variables, _pm_email_notify_token($params['recipient'], $params['message']));
   switch ($key) {
     case 'notice':
       $message['subject'] = t(variable_get('pm_email_notify_subject', 'New private message at !site.'), $variables, $language->language);
@@ -124,14 +124,14 @@ function pm_email_notify_mail($key, &$me
  * @return
  *  Array of mappings from token names to values (for use with strtr()).
  */
-function _pm_email_notify_token($message) {
+function _pm_email_notify_token($recipient, $message) {
 
   $tokens = array(
     '!author' => $message['author']->name,
     '!pm_subject' => drupal_html_to_text($message['subject'], array()),
     '!pm_body' => drupal_html_to_text($message['body'], array()),
     '!thread' => $message['thread_id'],
-    '!author_uid' => $message['author']->uid,
+    '!user_uid' => $recipient->uid,
   );
 
   return $tokens;
@@ -142,7 +142,7 @@ function _pm_email_notify_token($message
  * Returns default email notification body.
  */
 function _pm_email_notify_default_body() {
-  return "Hi !username,\n\nThis is an automatic reminder from the site !site. You have received a new private message from !author.\n\nTo read your message, follow this link:\n!uri/messages\n\nIf you don't want to receive these emails again, change your preferences here:\n!uri/user/!author_uid/edit";
+  return "Hi !username,\n\nThis is an automatic reminder from the site !site. You have received a new private message from !author.\n\nTo read your message, follow this link:\n!uri/messages\n\nIf you don't want to receive these emails again, change your preferences here:\n!uri/user/!user_uid/edit";
 }
 
 /**
