Closed (fixed)
Project:
Webform
Version:
6.x-2.3
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 Nov 2008 at 20:53 UTC
Updated:
2 Feb 2009 at 03:40 UTC
The docs for hook_mail ( http://api.drupal.org/api/function/hook_mail/6 ) state that $message['body'] should be an array, yet webform sets it to a string. This can cause errors if another module uses hook_mail_alter, and tries to add to the array with $message['body'][] = 'My addition...' . Patch follows.
--- webform.module (revision 1722)
+++ webform.module (working copy)
@@ -1197,7 +1197,7 @@
function webform_mail($key, &$message, $params) {
$message['headers'] = array_merge($message['headers'], $params['headers']);
$message['subject'] = $params['subject'];
- $message['body'] = $params['message'];
+ $message['body'] = preg_split('/\r?\n/', $params['message']);
}
/**
Comments
Comment #1
quicksketchThanks for the patch (sorry it took so long to review)! I think this also fixes #344668: Error Message : Unable to send e-mail. . Committed.
Comment #2
quicksketchThis issue caused the bug #360266: Extra Line Between Output Fields in E-mails. Which was fixed in that issue.