Warning When Sending Mail
nzwhost - February 29, 2008 - 09:31
| Project: | Mime Mail |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
I get the following warning when sending mail messages:
warning: Missing argument 2 for theme_mimemail_message() in /path-to-module/modules/mimemail/mimemail.module on line 384.I have corrected the issue by changing line 384 from:
function theme_mimemail_message($body, $mailkey) { to:
function theme_mimemail_message($body) {Problem has only occured since upgrading to the latest development version dated 2008-Feb-29

#1
That mailkey parameter was in fact added in a recent update. Removing it from the theme function regresses this functionality, so I'd rather see what's causing it and fix it there.
In the present mimemail code, there's only one call to "theme('mimemail_message')", and that has been updated to send the new mailkey parameter. Do you have any other modules installed, or anything else that might be making the call to theme('mimemail_message') without that $mailkey?
Thanks,
Allie
#2
I have noticed the problem occurring under a couple of different circumstances.
1. During user registration
2. When sending newsletters using simplenews module.
I have had a quick look at simplenews_template.module and noticed that it uses theme('mimemail_message') without $mailkey
#3
Interesting. I'm not sure why simplenews would do that - it should just be able to hand the HTML off to Mime Mail and have this module generate the message - rather than short-circuiting to the message body.
OK, fair enough though, I've committed a patch to make this an optional parameter in the theme function, so that should silence the error messages.
#4
Automatically closed -- issue fixed for two weeks with no activity.