Hi Bob,
Just realized that all these come and go make a mess.
I can put the email on contact_details table, so I don't need to make relations.
So I did:
1. Created a new form.
2. Created a dbRead onLoad (SETUP)
Enabled YES
Table _contact_details
Multi read YES
Model ID YES / Data1
Fields id,name
order name
3. Created dropdown (DESIGNER)
fieldname dropcontatos
fieldID dropcontatos
Dynamic Data
Enabled YES
Data Path Data1
Value Key id
Text Key name
4. Back to SETUP. Created DBRead OnSubmit
ActionLabel ColocarEmail
Enabled YES
Table contact_details
Multi REad YES
Model ID YES / Data3
Fields id,email_to
5. Right after, created CUSTOM CODE with suggested code
<?php
$juser = JFactory:;getUser($form->data['dropcontatos']);
$form->data['user_email'] = $juser->email;
?>
6. On Email action
Advance / Dynamic To user_email
I can open the list and choose a name.
But when I submit, it doesn't get the value.
The debuging result
Mailer Error: You must provide at least one recipient email address.
Data Array
Array
(
[option] => com_chronoforms5
[chronoform] => Contato2-db
[event] => submit
[nome] => asdfasdf
[dropcontatos] => 1
[textarea3] => asdfasdff
[button4] => Enviar
[0] => Array
(
[Data3] => Array
(
[id] => 1
[email_to] => ls@lselbh.com.br
)
)
[1] => Array
(
[Data3] => Array
(
[id] => 2
[email_to] =>
)
)
[2] => Array
(
[Data3] => Array
(
[id] => 3
[email_to] =>
)
)
[3] => Array
(
[Data3] => Array
(
[id] => 4
[email_to] => wester@luclch.com.br
)
)
[ip_address] => 16.23.1.83
)
Array
(
)
Errors
Array
(
)
Debug Info
Array
(
[2] => Array
(
[DB Read] => Array
(
[Queries] => Array
(
[0] => SELECT `Data3`.`id` AS `Data3.id`, `Data3`.`email_to` AS `Data3.email_to` FROM `joom336_contact_details` AS `Data3` LEFT JOIN `joom336_contact_details` AS `data3` ON `Data3`.`id` = `data3`.`id` GROUP BY `Data3`.`id`
)
)
)
[4] => Array
(
[Email] => Array
(
[0] => An email with the details below could NOT be sent:
[1] => To:
[2] => Subject:Contato Site Bcoiele
[3] => From name:nome
[4] => From email:
[5] => CC:
[6] => BCC:
[7] => Reply name:
[8] => Reply email:
[9] => Attachments:
[10] => Array
(
)
[11] => Body:
<table>
<tr><td>Nome</td><td>asdfasdf</td></tr>
<tr><td>Dropdown Label</td><td>1</td></tr>
<tr><td>Assunto</td><td>asdfasdff</td></tr>
</table><br /><br />IP: 86.23.44.83
)
)
)
I'm pretty sure that I must use the contact_details table instead of users table, but I believe that would be simple if I just retrieve the ID field from the ARRAY Data3 and choose the NAME from contact_details
How do I do that?
If it is a code where EXACTLY do I put the code??
Thanks (hope to finish this and stop bothering).
Lucas