Hi,
I would like to setting the Dynamic To with the data of my db
is it possible?
i have written this code for get the data
after i have inert utenti in Dynamic To, but don't work
can you help me?
thanks
I would like to setting the Dynamic To with the data of my db
is it possible?
i have written this code for get the data
<?php
$db =& JFactory::getDBO();
$query_user = "SELECT a.email FROM sks_users AS a, sks_user_usergroup_map AS b, sks_usergroups AS c WHERE a.id = b.user_id AND b.group_id = c.id AND c.title = 'Prova Invio Email' AND a.block =0";
$db->setQuery($query_user);
$form->data['utenti'] = $db->loadAssocList();
?>
after i have inert utenti in Dynamic To, but don't work
can you help me?
thanks
Hi federcla,
The query you have there will return an array of results not just a single email address. Add a Debugger action to see exactly what you are getting.
Bob
The query you have there will return an array of results not just a single email address. Add a Debugger action to see exactly what you are getting.
Bob
yes, I know it's an array, I need to load the addresses of the users of a particular group
Array
(
[Itemid] => 184
[option] => com_chronoforms
[view] => form
[utenti] => Array
(
[0] => Array
(
[email] => prova1@gmail.com
)
[1] => Array
(
[email] => prova2@gmail.com
)
[2] => Array
(
[email] => prova3@gmail.com
)
)
)
Hi federcla,
Hmmm . . . that's an array of arrays . . .
You can convert it to a plain array with a Custom Code action.
Then you can use my Email [GH] action* and put {dyn_emails} in the To Email box.
Bob
* The standard Email action won't accept an array or list of emails.
Hmmm . . . that's an array of arrays . . .
You can convert it to a plain array with a Custom Code action.
<?php
$form->data['dyn_emails'] = array();
foreach ( $form->data['utenti'] as $v ) {
$form->data['dyn_emails'][] = $v['email'];
}
?>
Then you can use my Email [GH] action* and put {dyn_emails} in the To Email box.
Bob
* The standard Email action won't accept an array or list of emails.
ok, now it is in a single array, but does not send the email, a message appears that says:
You must provide at least one receiver's email address
You must provide at least one receiver's email address
This topic is locked and no more replies can be posted.