using mimemail with send module, getting some errors related to array_merge, so i added a cast to array before the second argument in 2 such calls.

also, i hated the substitution of * for b and strong tags--i kept ending up with a lone asterisk as the first character of plaintext, then some blank lines, then all the copy, then some blank lines, and then a lone asterisk as the last character of plaintext. in a couple different themes.

i've attached a patch (only my second, don't know if i'm doing them correctly or not) for anyone interested.

CommentFileSizeAuthor
mimemail.inc.2006-02-20.patch1.75 KBrmiotke

Comments

rmiotke’s picture

whoops. forgot about a bigger problem, actually. not included in the previous patch because i don't know if there are other dependancies besides the send module.

function mimemail_html_body() returns a string if plaintext, but the send module is expecting an array either way. for my own purposes, since send is the only thing i'm using that's tied into mimemail, i changed this so that an array gets returned even if plaintext, like so:

$text = mimemail_html_to_text($body);
if ($plaintext) {
return array(
'body' => $text,
'headers' => array('Content-Type' => 'text/plain; charset=utf-8'),
);
}

allie micka’s picture

Status: Active » Fixed

Thanks so much for all the work and input here! Going forward, it will help if you can file separate issues for each item. There are really three things going on here, and it's a little messy to track.

Now:

1) Typecasting - There should be no legitimate reason for $headers to not be an array. It makes more sense to fix whatever code is sticking in non-arrays than to muck around with typecasting.

2) Speaking of invalid calls, you are correct about the plaintext thing. I think this may be the root cause of the issue you are reporting. I have applied your patch. Thanks a lot!

3) I agree about the * thing, but I'm closing this issue anyway because it's not on topic with the rest of the issue. I'll be looking into refactoring the html->text code, and will probably address this. If you still have issues, please go ahead and file them separately.

Thanks again!

Anonymous’s picture

Status: Fixed » Closed (fixed)