authorcontact_mail() $message['body'] should be an array

budda - May 6, 2009 - 11:52
Project:Author Contact
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

To allow other modules to hook_mail_alter() your modules email the $message['body'] that is returned from authorcontact_mail() should be an array rather than a string.

$message['body'][] = t('You have recieved an enquiry through @sitename on the page @nodetitle at @referer

This allows modules such as mollom to tack on a footer to your outbound email.
The documentation on http://api.drupal.org/api/function/drupal_mail/6 is also incorrect I feel.

'recieved' is also incorrectly spelt, it should be 'received'.

#1

budda - May 7, 2009 - 11:42

Documentation on api.drupal.org has been updated accordingly now too - #455172: drupal_mail() example encourages $message['body'] to be set as a string rather than array

#2

JustJamesAus - May 9, 2009 - 02:45

Thanks for drawing my attention to this budda.

I've changed the body to an array in the d6-dev version

#3

JustJamesAus - June 1, 2009 - 03:28
Status:active» fixed

#4

System Message - June 15, 2009 - 03:30
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.