Closed (works as designed)
Project:
Mime Mail
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
29 Jul 2007 at 20:02 UTC
Updated:
16 Nov 2007 at 20:38 UTC
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
Comment #1
somebodysysop commentedApparently, like this:
Comment #2
deekayen commentedYou 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