Having updated to version 7.x-1.0-Alpha1 I get the following message when I send an email:
Warning: trim() expects parameter 1 to be string, array given in mimemail_mail() (line 268 of .../sites/all/modules/mimemail/mimemail.module).
Looking at the source file, line 268 reads:
$attachments_string = trim($params['attachments']);
However, if I am reading the code correctly, line 247 of the same file is defining element 'attachments' as an array in its own right, consequently line 268 is trying to trim an array, not a string! (I am assuming here that function mimemail_rules_action_info() defines the structure of array $params)
The email was created using mass_messaging 7.x-1.0-beta2 and mimemail 7.x-1.0-Alpha1, views 7.x-3.2 and sent using Rules 7.x-2.0. The email did not have an attachment!
Comment | File | Size | Author |
---|---|---|---|
#5 | mass_messaging-attachments_from-1451154-5.patch | 6.19 KB | bradjones1 |
Comments
Comment #1
sgabe CreditAttribution: sgabe commentedI am moving this to Mass Messaging and copying my explanation from #1428798: Attachments reset in $params since this is the same case. Mime Mail implements hook_mail() in favor of Rules support and no other module should call drupal_mail('mimemail', [...]).
Comment #2
kovaski CreditAttribution: kovaski commentedAlthough the mail is sent, the attachments do not work. According to the answer above, would have to modify the file: mass_messaging_mail.module. Change "mimemail" function "drupal_mail" to a new module. But what can we do?
Thanks for your help.
Comment #3
nhck CreditAttribution: nhck commentedBasically the mass_messaging_mail.module is an incorrect usage of mimemail. You would need to implement hook_mail which mass_messaging_mail.module does not.
Also the attachments part is commented out and replaced by a debug code in the current version.
Comment #4
bradjones1This patch adds attachment support and also addresses setting the sender.
As noted in #3, you should set the mail system to MimeMail through the admin UI.
I'll also be adding a ticket regarding maintenance of this module; it seems like there's a critical mass of users, but there hasn't been much work on this in the last 2 years.
Comment #5
bradjones1An updated patch.