--- actions.inc	2007-12-30 21:45:01.000000000 -0500
+++ actions.inc.new	2008-01-11 06:54:16.000000000 -0500
@@ -293,7 +293,7 @@
  * be exposed by node.module.
  *
  */
-function action_send_email($op, $edit = array(), $node) {
+function action_send_email($op, $edit = array(), $node = NULL) {
   switch($op) {
     case 'metadata':
       return array(
@@ -318,7 +318,7 @@
       if (isset($node) && is_object($node)) {
         $variables = array(
           '%site_name' => $site_name,
-          '%username' => $user->name,
+          '%username' => ($node->uid) ? $user->name : variable_get('anonymous', 'Anonymous'),
           '%uid' => $node->uid,
           '%node_url' => url('node/' . $node->nid, NULL, NULL, TRUE),
           '%node_type' => $node->type,
