Form email plugin - email to (eval)

varst

Member
Hi!

In the field "Email to (eval)" code is:
// get the groups (raw data so we get the ids not the labels)
$myGroups = $this->data['trennid___usergroup_raw'];
// call the Fabrik getUsersInGroups method to get emails for the selected groups
$myEmails = $this->getUsersInGroups($myGroups, $field = 'email');
// return resulting array as comma separate string
return implode(',', $myEmails);

On J3 it works fine, but on J4 i have error:
0
Call to undefined method FabrikEvalClass_00d826fdf15c6f68ef7f51f35c55f738::getUsersInGroups()
 
With F4 we have isolated all of the php code used in all of the various eval places throughout. This is to protect the Fabrik code from potentially being damaged due to variable name collisions. In the past it was possible to call some Fabrik functions that were visible, this is no longer the case. For your situation simply use the following code to get the same information:

Code:
        $db    = FabrikWorker::getDbo();
        $query = $db->getQuery(true);
        $query->select('DISTINCT(email)')->from('#__users AS u')->join('LEFT', '#__user_usergroup_map AS m ON u.id = m.user_id')
            ->where('m.group_id IN (' . implode(', ', $myGroups) . ')');
        $db->setQuery($query);

        $myEmails = $db->loadColumn();
 
We are in need of some funding.
More details.

Thank you.

Staff online

Members online

Back
Top