Hi everyone:
I'm struggling a bit with emailing joined data. I have a databasejoin element that connects to some Sobi tables. The element shows a checkbox list of all the records in sobi.
This is all working great. The problem is trying to email the list of selected sobi items (displayed as a checkbox) to an email. I'm using my own email template, but it has this code for pulling joined data:
This comes directly from the debug.php file. When I receive this email, the output this code is generating is:
Not sure what is causing the problem here. It's outputting the proper record IDs, but not the labels. When I do a print_r($joindata) the labels *do* come through correctly, but of course parsing through those arrays is a pain.
Any ideas on how to get this operating correctly? Thanks!
(PS: Github update Nov 1 2012)
I'm struggling a bit with emailing joined data. I have a databasejoin element that connects to some Sobi tables. The element shows a checkbox list of all the records in sobi.
This is all working great. The problem is trying to email the list of selected sobi items (displayed as a checkbox) to an email. I'm using my own email template, but it has this code for pulling joined data:
$joindata = $this->data['join'];
foreach (array_keys($joindata) as $joinkey) :
$keys = array_keys($joindata[$joinkey]);
$length = count($joindata[$joinkey][$keys[0]]);
for ($i = 0; $i < $length; $i++) :
echo '<tr><td colspan="2"><h3>record ' . $i . '</h3></td></tr>';
foreach ($keys as $k) :
echo '<tr><td>' . $k . '</td><td>' . $this->data['join'][$joinkey][$k][$i] . '</td></tr>';
endforeach;
endfor;
endforeach;
This comes directly from the debug.php file. When I receive this email, the output this code is generating is:
Code:
Join data
Below out puts the form's join data one record at a time:
record 0
tbl_brochure_request_form_repeat_entry_selects___entry_selects_raw 450
tbl_brochure_request_form_repeat_entry_selects___entry_selects <
record 1
tbl_brochure_request_form_repeat_entry_selects___entry_selects_raw 74
tbl_brochure_request_form_repeat_entry_selects___entry_selects u
Not sure what is causing the problem here. It's outputting the proper record IDs, but not the labels. When I do a print_r($joindata) the labels *do* come through correctly, but of course parsing through those arrays is a pain.
Any ideas on how to get this operating correctly? Thanks!
(PS: Github update Nov 1 2012)