To send the email I need to get the user's email from the jos_users db.
The relationship is standard (cf_user_id from jos_submissions = id from jos_users).
I assume I'm right in using two DB Record Loader actions.
The first is displaying data from the jos_submissions table, no problem.
How do I get the second to display name and email from the jos_users table?
I have set a Model ID 'User' in the jos_submissions DB Loader and tried a number of WHERE statements in the jos_users DB Loader none of which work:
On the form preview is a custom code element:
<?php echo "Submitted by ".$user['name']." ".$user['email']; ?>
I've swopped things around endlessly but don't really understand which of the Model IDs and WHERE statements are doing the work!
The full current settings are:
DB Record Loader 1 (working OK)
DB Field: cf_id
Table: jos_submissions
Request Param: cf_id
Load Fields: Yes
Model ID: User
Load Under Model ID: No
WHERE statement (empty)
DB Record Loader 2 (producing no results)
DB Field: id
Table: jos_users
Request Param: id
Load Fields: Yes
Model ID:
Load Under Model ID: No
WHERE statement (below)
<?php
$user = $form->data['User'];
?>
`id` = <?php echo $user['cf_user_id']; ?>
Any guidance would be appreciated,
Nick