I have installed Mime Mail 7.x-1.0-alpha1 and got it set up and working for the most part. The thing I'm having trouble with is getting it to recognize a by-mailkey template. I have been able to copy the mimemail-message.tpl.php into my theme directory, modify it and have it apply to the HTML email I am sending just fine. I can put that file anywhere in my theme directory and it finds it and overrides the default. I cannot however get it to recognize a by-mailkey template no matter where I put it in my theme directory.

I have an email with the key help_wanted set. I have created a template file called mimemail-message--help-wanted.tpl.php, which I believe is the correct template name to apply to the email with that key. I have cleared the cache and sent the email, but the default template is still applied.

I have also tried using mimemail-message--help_wanted.tpl.php with no luck.

I know the proper key is being passed because I can set up the mimemail-message.tpl.php to override the default template and print out the $key variable in the template and get help-wanted.

Does anyone have any experience with this and might know what I could be doing wrong?

2 Answers 2


Use latest dev version of Mime Mall module. It doesn't work in 7.x-1.0-alpha1 and 7.x-1.0-alpha2.

But you can also make a quick hack. In file mimemail.module need to comment the row #531

$key = str_replace('_', '-', $key);

After that you can use mimemail-message--help-wanted.tpl.php template.

  • I dont think we can change the mimemail directly like this
    – Stone Vo
    Commented May 8, 2013 at 4:49

The templating engine should not use underscores '_'. They should automatically be replaced by hyphens '-'. So did you try to change something like mimemail-message--help--wanted.tpl.php

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.