Closed (duplicate)
Project:
Forward
Version:
5.x-1.4
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
1 Aug 2007 at 18:42 UTC
Updated:
1 Feb 2012 at 21:48 UTC
Hi,
For our site we thought it would be useful for users to be able to send nodes to members of their buddylist as well as email addresses. Here is the code I added at Line 422 to accomplish this:
$buddies = @buddylist_get_buddies($GLOBALS['user']->uid);
foreach ($recipient_addresses as $address) {
if ((user_validate_mail($address)) && ($address != '')) {
if($buddies) {
$match = false;
foreach($buddies as $item => $value) {
if(strtolower($value['name']) == strtolower($address)) {
$address = $value['mail'];
$match = true;
break;
}
}
if (!$match) {
form_set_error('recipients', t('One of your Recipient addresses is invalid:') .'<br />'. $address);
}
}
}
}
I'm sure it can be cleaned up, but that's the first draft anyway.
Comments
Comment #1
bsonnich commentedSorry, that's not a complete solution. I had to do a bit more tweaking to get it fixed up. The key was in making $recipient_addresses a global variable so that it could be used in the send function rather than the $recipients variable.
Comment #2
john.oltman commented