Closed (fixed)
Project:
Mime Mail
Version:
6.x-1.0-beta2
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
23 Nov 2011 at 22:47 UTC
Updated:
8 Apr 2013 at 13:40 UTC
I've got a custom template up on a site, but i'd like to use it just for a specific newsletter content type. I know that requires the use of a $mailkey reference, but I don't know how to implement that between the site and the tpl.php file.
Please assist. Thanks
Comments
Comment #1
sgabe commentedYou can check the mailkey in the message source. Look for something like
<body id="mimemail-body" class="mailkey-mail-simplenews-test">, mail-simplenews-test is the mailkey here. You can use mimemail-message--[mailkey].tpl.php for a specific mailkey.Comment #2
sgabe commentedClosing due to no response.
Comment #3
mottolini commentedI just want to add here a comment to help people find a solution to a severe documentation "bug"...
It's correct that you have to create a template file in the form mimemail-message--[mailkey].tpl.php, but you DON'T have to look at the class in the body tag for the generated html mail!
$mailkey value is changed in the function template_preprocess_mimemail_message (mimemail.theme.inc) with this line:
$variables['mailkey'] = 'mail-'. str_replace('_', '-', $variables['mailkey']);So, you have to look for the real mailkey in the source code of the module creating that email or:
Comment #4
Marko B commentedI am using views send, and mailkey there is not present. This is what I get class="mail-" mailkey should be a module creating mail as this way it seems we can't use this theming?
Comment #5
Marko B commentedFrom my testing so far the only difference between mailkey in body tag and mailkey needed for template is that in body you have
$mailkey which is mailkey-mail-simplenews-test and you only use simplenews-test, so in the end you have
mimemail-message--simplenews-test.tpl.php which is same logi as #3 said. So guess this is how mailkey should be used.