I'm currently using this code to send out notifications:

      // Send notification of new og subscription to administrators of group;
      if (variable_get('og_user_roles_notify_default', 0) == 1 && module_exists('mimemail')) {
        $group = check_plain($node->title);
        $sender = variable_get('site_mail', '');
        $subject = t('User @user added to group: @group', array('@user' => $user->name, '@group' => $group));
        $message = t('User @user added to group: @group.', array('@user' => theme('username', $user), '@group' => l($group, "node/$nid")));
        $result = db_query("SELECT uid FROM {og_uid} WHERE is_admin = 1 AND nid = %d", $nid);

        while ($obj = db_fetch_object($result)) {
          $recipient_uid = $obj->uid;
          $recipient_user = user_load(array('uid' => $recipient_uid));
          $recipient = $recipient_user->mail;
          mimemail($sender, $recipient, $subject, $message);
//          drupal_mail('og_user_roles_new_subscription', $recipient, $subject, $message, $sender);
        } // end while
      } // end if

However, the email I receive looks exactly like this:

User <a href="/user/3" title="View user profile.">test02</a> added to group: <a href="/node/29">Test Group 1</a>.

How do I correctly format the user and group links? Thanks!

Comments

somebodysysop’s picture

Apparently, like this:

        $message = "User " . l($user->name, "user/$user->uid", array(), NULL, NULL, TRUE) . " added to group: " . l($group, "node/$nid", array(), NULL, NULL, TRUE);
deekayen’s picture

Status: Active » Closed (works as designed)

You had the right idea the first time, only you used the wrong substitution character in t(). The output you got is exactly correct, but I think you intended to use ! instead of @.

See !variable on http://api.drupal.org/api/function/t/5