Closed (fixed)
Project:
form_mail
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
28 Nov 2004 at 12:30 UTC
Updated:
12 Dec 2004 at 13:15 UTC
I noticed on a test run that the keys were not being grabbed.
What was happening was when the body was written, it would overwrite everything else since it was a straight variable assignment instead of an append.
Specifically:
function form_mail_send_email($edit) {
unset($edit["op"]);
foreach ($edit as $key => $value) {
if ($key == "to" && variable_get("form_mail_custom_to", 0)) {
$to = $value;
}
elseif ($key == "body") {
$body = $value;
break;
}
else {
$body .= "$key: $value\n";
}
}
should be...
function form_mail_send_email($edit) {
unset($edit["op"]);
foreach ($edit as $key => $value) {
if ($key == "to" && variable_get("form_mail_custom_to", 0)) {
$to = $value;
}
elseif ($key == "body") {
$body .= $value;
break;
}
else {
$body .= "$key: $value\n";
}
}
N.B. the $body .= $value;
Hope this helps someone.
-J
Comments
Comment #1
(not verified) commented