Hi
We found that the Contact Fields module did not return all the user-defined fields in the e-mail it sends. It only returned the first one of each type. To fix this, we changed the code in contact_field_mail_alter() in contact_field.module. We changed
$am__fields = _get_enabled_fields();
if (!variable_get("contact_field_use_template", 0)) {
$ss__additional = t("Additional information") ."\n";
foreach ($am__fields as $type => $field) {
$as__title = array_values($field);
$as__field = array_keys($field);
if (is_array($message['params'][$as__field[0]])) {
$ss__value = _get_field_setting($as__field[0], $message['params'][$as__field[0]]);
$ss__additional .= $as__title[0].": \t". $ss__value ."\n";
}
else {
$ss__additional .= $as__title[0] .": \t". $message['params'][$as__field[0]] ."\n";
}
}
$message['body'][] = "\n". $ss__additional;
}
to
if(!is_array($message['body'])) {
$message['body'] = array($message['body']);
}
$am__fields = _get_support_enabled_fields();
if (!variable_get("support_field_use_template", 0)) {
$ss__additional = t("Additional information") ."\n";
foreach ($am__fields as $type => $field) {
foreach ($field as $as__field => $as__title) {
if (is_array($message['params'][$as__field])) {
$ss__value = _get_support_field_setting($as__field, $message['params'][$as__field]);
$ss__additional .= $as__title.": \t". $ss__value ."\n";
}
else {
$ss__additional .= $as__title .": \t". $message['params'][$as__field] ."\n";
}
}
}
$message['body'][] = "\n". $ss__additional;
}
Comments
Comment #1
pnijjar commentedThe above patch does not work for me as listed. There are functions with the title "support" (_get_support_enabled_fields()) that do not exist in my installation.
I rerolled the function to get it working for me, but it appears to be unnecessary. This issue looks like a duplicate of #894470: Only a single text field can be sent to recipient via email . I did not see it at first because I was looking at the open bugs.
Comment #2
beautifulmindHello,
Please try the dev version.
Thanks for your concern and using the module.
Regards.
Comment #3
beautifulmindComment #4
kenorb commented