Integrate User Badges (http://drupal.org/project/user_badges) with Activity2 (http://drupal.org/project/activity) to generate messages when users are assigned badges.
Activity provides a fully documented API – find in DEVELOPERS.txt (in the root directory of the Activity module).
Please post “I read the project” in the pmb so I know you read this.
More details at http://drupal.org/node/873206