Problem with e-mail form plugin

sob_k

Member
Hi,
in my form a have e-mail form plugin, in form i have dbjoin element - multiselect to user id (wiadomosci___filia_partner).
So i have users id, now I want set e-mail to selected users but I don't know to get data (id user) from form (dbjoin).
I try this:

Code:
$myId[0]= $this->data['wiadomosci___filia_partner_raw'];
//$myId = is_array($myId) ? $myId[0] : $myId;
if (!empty($myId)) {
    foreach ($myId as $v) {   
         $myUser = JFactory::getUser((int)$v); 
         $email=$myUser->get('email');
       return $email;
}

}
return '';
But this don't work
So i try do similary i calc element in this form a put
Code:
$myId[0]= '{wiadomosci___filia_partner_raw}';
//$myId = is_array($myId) ? $myId[0] : $myId;
if (!empty($myId)) {

    foreach ($myId as $v) {   
         $myUser = JFactory::getUser((int)$v); 
         $email=$myUser->get('email');
       return $email;
}

}
return '';
Ajax calculation : YES
Ajax observe fields: '{wiadomosci___filia_partner}'
And I see e-mail only first selected user.

What I am doing wrong?
 
Code:
$myEmails = array();
$myIds = $this->data['wiadomosci___filia_partner_raw'];
foreach ($myIds as $myId) {
   $myEmails[] = JFactory::getUser($myId)->get('email');
}
return implode(',', $myEmails);

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top