Not sure if this is my misconfig or a bug/feature of FormTools:
I've set up a checkbox group which collects values like
lt_ffel_fff|lt_fdir_ddd|lt_fout_fff|lt_plus and set the corresponding display text to something more legible for the clients eg. Loan Type External, Loan Type Internal etc.
and while viewing the submissions in FormTools is perfect, with the checkboxes displayed with display text, I see the email notifications coming through with just the raw data, eg.
Loan Type
lt_ffel_fff|lt_fdir_ddd|lt_fout_fff|lt_plus
I have changed the data array delimiter for the whole script to be pipe, as you can see - has this screwed with the display text being set in the email template? Or...?
That should only output the comma-delimited value, not the original value. I have to ask: are you sure the submission you're testing with has a value in that field?
Good GRIEF, this is actually a bug with 2.0.6 - how remarkable. You're not doing anything wrong - the email template is just being passed the raw values; not the actual display values. Let me think about this.
Jul 1st, 2011, 10:32 AM (This post was last modified: Jul 1st, 2011, 10:32 AM by Ben.)
Well! That was surprising. So yeah, there's a bug in the code that's just outputting the values - not the display values. Astonishing no-one's mentioned it...!
I'm not going to release a patch release for this, though. It'll be fixed in 2.1, but I won't release 2.0.7 just to fix this one issue.
However, to fix it in your case, just replace the _ft_get_placeholder_hash() function on line 1345 of /code/emails.php with this code:
Code:
/**
* Generates the email content for a particular template - either HTML or text.
*
* @param integer $form_id The unique form ID
* @param integer $submission_id The unique submission ID
* @param array $client_info a hash of information about the user to whom this email is being sent
* @return array a hash of placeholders and their replacement values (e.g. $arr["FORMURL"] => 17)
*/
function _ft_get_placeholder_hash($form_id, $submission_id, $client_info = "")
{
global $g_root_url, $g_multi_val_delimiter;
// now loop through the info stored for this particular submission and for this particular field,
// add the custom submission responses to the placeholder hash
foreach ($submission_info as $field)
{
$field_id = $field["field_id"];
$field_name = $field["field_name"];
$field_type = $field["field_type"];
if ($field_type != "system")
$placeholders["QUESTION_$field_name"] = $field["field_title"];
Your code hack did the trick - multi-variable fields are now printing out one variable per line in emails with display text OK - it's a beautiful thing:
Quote:Loan Type
STUDENT LOAN MARKETING ASSOC./TEXAS
Loan Type
OREGON STUDENT ASSISTANCE COMMISSION