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:
That should fix it up!
Let me know if you continue to have problems.
- Ben
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;
$placeholders = array();
$settings = ft_get_settings();
$form_info = ft_get_form($form_id);
$submission_info = ft_get_submission($form_id, $submission_id);
$admin_info = ft_get_admin_info();
// 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"];
if ($field_type == "file")
{
$extended_settings = ft_get_extended_field_settings($field_id, "core");
$placeholders["FILENAME_$field_name"] = $field["content"];
$placeholders["FILEURL_$field_name"] = "{$extended_settings["file_upload_url"]}/{$field["content"]}";
}
else
{
if ($field_type != "system")
{
if (in_array($field_type, array("radio-buttons", "checkboxes", "select", "multi-select")))
{
$content = "";
if (!empty($field["content"]))
{
$options = ft_get_field_options($field_id);
$vals = explode($g_multi_val_delimiter, $field["content"]);
$display_vals = array();
foreach ($options as $option_info)
{
if (in_array($option_info["option_value"], $vals))
{
$display_vals[] = $option_info["option_name"];
}
}
$content = implode(", ", $display_vals);
}
$placeholders["ANSWER_$field_name"] = $content;
}
else
{
$placeholders["ANSWER_$field_name"] = $field["content"];
}
}
}
if ($field['col_name'] == "submission_date")
$placeholders["SUBMISSIONDATE"] = ft_get_date($settings['default_timezone_offset'], $field["content"], $settings["default_date_format"]);
if ($field['col_name'] == "last_modified_date")
$placeholders["LASTMODIFIEDDATE"] = ft_get_date($settings['default_timezone_offset'], $field["content"], $settings['default_date_format']);
if ($field['col_name'] == "ip_address")
$placeholders["IPADDRESS"] = $field["content"];
}
$placeholders["ADMINEMAIL"] = $admin_info["email"];
$placeholders["FORMNAME"] = $form_info["form_name"];
$placeholders["FORMURL"] = $form_info["form_url"];
$placeholders["SUBMISSIONID"] = $submission_id;
$placeholders["LOGINURL"] = $g_root_url . "/index.php";
if (!empty($client_info))
{
$placeholders["EMAIL"] = $client_info["email"];
$placeholders["FIRSTNAME"] = $client_info["first_name"];
$placeholders["LASTNAME"] = $client_info["last_name"];
$placeholders["COMPANYNAME"] = $client_info["company_name"];
}
extract(ft_process_hooks("end", compact("placeholders"), array("placeholders")), EXTR_OVERWRITE);
return $placeholders;
}
That should fix it up!
Let me know if you continue to have problems.
- Ben