I'm using the Mime mail for all system emails as well as for Simplenews --- my confirmation emails were blank... I investigated the code and found the following issue:

mimemail.module - line 95

function mimemail_prepare ($sender, $recipient, $subject, $body, $plaintext = NULL, $headers = array(), $text = NULL, $attachments = array(), $mailkey = '') {
...[omitted code]...
$body = theme('mimemail_message', $body, $mailkey);
...

Before the call of the theme('mimemail_message') my $body variable is populated.... when it returns from the themeing, it's blank. I'm trying to find out why... I put debug into the mimemail.tpl.php but it's not spitting anything out, so I don't know whether it's actually getting called or not.

If you replace the $body=theme with the code from the mimemail.tpl.php:

template_preprocess_mimemail_message($variables);
$css = $variables['css'];
$body = '<html>
	  <head>
	    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	    <style type="text/css">
	      '.$css.'
	    </style>
	  </head>
	  <body id="mimemail-body">
	    <div id="center">
	      <div id="main">'
	        . $body.'
	      </div>
	    </div>
	  </body>
	</html>';

The emails will come through fine... just ugly and not the way the system should work. The theme function needs to be fixed so it can be appropriately used with hooks/overrides. Any ideas?

Comments

edriscoll’s picture

I'm seeing something similar, but thus far it's only happened once that I know of (email notifying a new user of their account was blank); I've created multiple test accounts, which all receive the configured notification. I'm running Drupal 6.14.

sgabe’s picture

Status: Active » Closed (duplicate)

There is a similar issue in the queue with more followup so I am marking this as a duplicate of #910884: Empty body in HTML version.