I'm invoking the mimemail engine using 7.0-1.0alpha1 in a Rules action, using code based upon webform.module's implementation, which works.
The problem is that while my override of mimemail-message.tpl.php is found in my theme folder and called, my copy of mail.css is never used. It turns out that while my own preprocess function gets called, template_preprocess_mimemail_message() is never called when you invoke mimemail webform-style. After debugging this, I find that function_exists() does not find the function, because mimemail/themes/mimemail.theme.inc is never lazy loaded.
The work-around is for me to load the file myself in my preprocess function, and call the function myself:
if (!isset($variables['css'])) {
//there is an intermittent bug in mimemail.module where
//its preprocess function is not called on some paths. We
//explicity call it in that case:
$variables['css'] = '';
if (!function_exists('template_preprocess_mimemail_message')) {
//last ditch effort to get things loaded
$path = drupal_get_path('module', 'mimemail') . "/theme/mimemail.theme.inc";
@include_once $path;
}
if (function_exists('template_preprocess_mimemail_message')) {
template_preprocess_mimemail_message($variables);
}
}
Obviously, this is a way evil hack.
Not sure how best to fix this in the mimemail module, and my evil, evil hack will likely break in a near future release of mimemail, but at least it's clear what's going on.